diff options
author | Dan Timoney <dtimoney@att.com> | 2020-07-30 14:02:14 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2020-07-30 14:02:14 -0400 |
commit | d998254cf8b8888b85cca8f59f9efeed5a55f053 (patch) | |
tree | 6a8ce9733ecc2b47635c95027494f5ee0916394c /ms | |
parent | f308dfd9d85590129215765ca37e635dd86607e2 (diff) |
Implement service topology operation RPC
Add implementation for service-topology-operation RPC.
Change-Id: I154d2ef6504be9a592479acc554b7cb0f8c250f6
Issue-ID: SDNC-1310
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'ms')
235 files changed, 78414 insertions, 5073 deletions
diff --git a/ms/generic-resource-api/pom.xml b/ms/generic-resource-api/pom.xml index da78e74..0b0434a 100644 --- a/ms/generic-resource-api/pom.xml +++ b/ms/generic-resource-api/pom.xml @@ -115,6 +115,11 @@ <version>${ccsdk.sli.core.version}</version> </dependency> <dependency> + <groupId>org.onap.ccsdk.sli.adaptors</groupId> + <artifactId>sql-resource-provider</artifactId> + <version>${ccsdk.sli.adaptors.version}</version> + </dependency> + <dependency> <groupId>org.onap.ccsdk.sli.plugins</groupId> <artifactId>restapi-call-node-provider</artifactId> <version>${ccsdk.sli.plugins.version}</version> @@ -124,6 +129,7 @@ <artifactId>properties-node-provider</artifactId> <version>${ccsdk.sli.plugins.version}</version> </dependency> + <!-- this jersey jar is needed for rest api call node to function properly --> <dependency> <groupId>org.glassfish.jersey.inject</groupId> @@ -204,34 +210,6 @@ </execution> </executions> </plugin> - <!-- Workaround : for some reason, BeforeClass is not triggered in junit on Jenkins --> - <!-- So cannot override default value of serviceLogicDirectory property --> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <version>2.6</version> - <executions> - <execution> - <id>copy-dockerfile</id> - <goals> - <goal>copy-resources</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <outputDirectory>${basedir}/src/main/resources</outputDirectory> - <resources> - <resource> - <directory>${basedir}/target/docker-stage/opt/onap/sdnc/svclogic/graphs/generic-resource-api</directory> - <includes> - <include>*.xml</include> - <include>graph.versions</include> - </includes> - <filtering>false</filtering> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> diff --git a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiController.java b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiController.java index f2bb0d2..700dbb0 100644 --- a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiController.java +++ b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiController.java @@ -25,14 +25,20 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.JsonParser; + +import org.onap.ccsdk.apps.services.RestException; import org.onap.ccsdk.apps.services.SvcLogicFactory; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase; import org.onap.sdnc.apps.ms.gra.data.ConfigPreloadData; import org.onap.sdnc.apps.ms.gra.data.ConfigPreloadDataRepository; +import org.onap.sdnc.apps.ms.gra.data.ConfigServices; +import org.onap.sdnc.apps.ms.gra.data.ConfigServicesRepository; import org.onap.sdnc.apps.ms.gra.data.OperationalPreloadData; import org.onap.sdnc.apps.ms.gra.data.OperationalPreloadDataRepository; +import org.onap.sdnc.apps.ms.gra.data.OperationalServices; +import org.onap.sdnc.apps.ms.gra.data.OperationalServicesRepository; import org.onap.sdnc.apps.ms.gra.swagger.OperationsApi; import org.onap.sdnc.apps.ms.gra.swagger.model.*; import org.springframework.beans.factory.annotation.Autowired; @@ -45,12 +51,14 @@ import org.springframework.stereotype.Controller; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; - @Controller -@ComponentScan(basePackages = {"org.onap.sdnc.apps.ms.gra.*"}) +@ComponentScan(basePackages = { "org.onap.sdnc.apps.ms.gra.*", "org.onap.ccsdk.apps.services" }) @EntityScan("org.onap.sdnc.apps.ms.gra.*") @Import(value = SvcLogicFactory.class) public class OperationsApiController implements OperationsApi { @@ -71,6 +79,28 @@ public class OperationsApiController implements OperationsApi { @Autowired private OperationalPreloadDataRepository operationalPreloadDataRepository; + @Autowired + private ConfigServicesRepository configServicesRepository; + + @Autowired + private OperationalServicesRepository operationalServicesRepository; + + private static class Iso8601Util { + + private static TimeZone timeZone = TimeZone.getTimeZone("UTC"); + private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + + private Iso8601Util() { + } + + static { + dateFormat.setTimeZone(timeZone); + } + + private static String now() { + return dateFormat.format(new Date()); + } + } @org.springframework.beans.factory.annotation.Autowired public OperationsApiController(ObjectMapper objectMapper, HttpServletRequest request) { @@ -91,7 +121,8 @@ public class OperationsApiController implements OperationsApi { } @Override - public ResponseEntity<GenericResourceApiPreloadNetworkTopologyOperation> operationsGENERICRESOURCEAPIpreloadNetworkTopologyOperationPost(@Valid GenericResourceApiPreloadnetworktopologyoperationInputBodyparam graInput) { + public ResponseEntity<GenericResourceApiPreloadNetworkTopologyOperation> operationsGENERICRESOURCEAPIpreloadNetworkTopologyOperationPost( + @Valid GenericResourceApiPreloadnetworktopologyoperationInputBodyparam graInput) { final String svcOperation = "preload-network-topology-operation"; GenericResourceApiPreloadNetworkTopologyOperation retval = new GenericResourceApiPreloadNetworkTopologyOperation(); GenericResourceApiPreloadTopologyResponseBody resp = new GenericResourceApiPreloadTopologyResponseBody(); @@ -100,18 +131,17 @@ public class OperationsApiController implements OperationsApi { if (hasInvalidPreloadNetwork(graInput)) { log.debug("exiting {} because of null or empty preload-network-topology-information", svcOperation); - resp.setResponseCode("403"); resp.setResponseMessage("invalid input, null or empty preload-network-topology-information"); resp.setAckFinalIndicator("Y"); - retval.setOutput(resp); return new ResponseEntity<>(retval, HttpStatus.FORBIDDEN); } - String preloadId = graInput.getInput().getPreloadNetworkTopologyInformation().getNetworkTopologyIdentifierStructure().getNetworkId(); + String preloadId = graInput.getInput().getPreloadNetworkTopologyInformation() + .getNetworkTopologyIdentifierStructure().getNetworkId(); String preloadType = "network"; resp.setSvcRequestId(graInput.getInput().getSdncRequestHeader().getSvcRequestId()); @@ -120,10 +150,9 @@ public class OperationsApiController implements OperationsApi { GenericResourceApiPreloaddataPreloadData preloadData = null; - // Add input to SvcLogicContext try { - ctxIn.mergeJson(svcOperation+"-input", objectMapper.writeValueAsString(graInput.getInput())); + ctxIn.mergeJson(svcOperation + "-input", objectMapper.writeValueAsString(graInput.getInput())); } catch (JsonProcessingException e) { log.error("exiting {} due to parse error on input preload data", svcOperation); resp.setResponseCode("500"); @@ -133,7 +162,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Add config tree data to SvcLogicContext try { preloadData = getConfigPreloadData(preloadId, preloadType); @@ -147,7 +175,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Add operational tree data to SvcLogicContext try { preloadData = getOperationalPreloadData(preloadId, preloadType); @@ -161,7 +188,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Call DG try { // Any of these can throw a nullpointer exception @@ -177,7 +203,8 @@ public class OperationsApiController implements OperationsApi { // If DG returns success, update database String ctxJson = ctxOut.toJsonString("preload-data"); log.info("DG preload-data is {}", ctxJson); - GenericResourceApiPreloaddataPreloadData preloadToLoad = objectMapper.readValue(ctxJson, GenericResourceApiPreloaddataPreloadData.class); + GenericResourceApiPreloaddataPreloadData preloadToLoad = objectMapper.readValue(ctxJson, + GenericResourceApiPreloaddataPreloadData.class); saveConfigPreloadData(preloadId, preloadType, preloadToLoad); saveOperationalPreloadData(preloadId, preloadType, preloadToLoad); } @@ -204,13 +231,13 @@ public class OperationsApiController implements OperationsApi { resp.setResponseMessage(e.getMessage()); } - retval.setOutput(resp); return (new ResponseEntity<>(retval, HttpStatus.valueOf(Integer.parseInt(resp.getResponseCode())))); } @Override - public ResponseEntity<GenericResourceApiPreloadVfModuleTopologyOperation> operationsGENERICRESOURCEAPIpreloadVfModuleTopologyOperationPost(@Valid GenericResourceApiPreloadvfmoduletopologyoperationInputBodyparam graInput) { + public ResponseEntity<GenericResourceApiPreloadVfModuleTopologyOperation> operationsGENERICRESOURCEAPIpreloadVfModuleTopologyOperationPost( + @Valid GenericResourceApiPreloadvfmoduletopologyoperationInputBodyparam graInput) { final String svcOperation = "preload-vf-module-topology-operation"; GenericResourceApiPreloadVfModuleTopologyOperation retval = new GenericResourceApiPreloadVfModuleTopologyOperation(); GenericResourceApiPreloadTopologyResponseBody resp = new GenericResourceApiPreloadTopologyResponseBody(); @@ -219,18 +246,17 @@ public class OperationsApiController implements OperationsApi { if (hasInvalidPreloadNetwork(graInput)) { log.debug("exiting {} because of null or empty preload-network-topology-information", svcOperation); - resp.setResponseCode("403"); resp.setResponseMessage("invalid input, null or empty preload-network-topology-information"); resp.setAckFinalIndicator("Y"); - retval.setOutput(resp); return new ResponseEntity<>(retval, HttpStatus.FORBIDDEN); } - String preloadId = graInput.getInput().getPreloadVfModuleTopologyInformation().getVfModuleTopology().getVfModuleTopologyIdentifier().getVfModuleName(); + String preloadId = graInput.getInput().getPreloadVfModuleTopologyInformation().getVfModuleTopology() + .getVfModuleTopologyIdentifier().getVfModuleName(); String preloadType = "vf-module"; resp.setSvcRequestId(graInput.getInput().getSdncRequestHeader().getSvcRequestId()); @@ -239,10 +265,9 @@ public class OperationsApiController implements OperationsApi { GenericResourceApiPreloaddataPreloadData preloadData = null; - // Add input to SvcLogicContext try { - ctxIn.mergeJson(svcOperation+"-input", objectMapper.writeValueAsString(graInput.getInput())); + ctxIn.mergeJson(svcOperation + "-input", objectMapper.writeValueAsString(graInput.getInput())); } catch (JsonProcessingException e) { log.error("exiting {} due to parse error on input preload data", svcOperation); resp.setResponseCode("500"); @@ -252,7 +277,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Add config tree data to SvcLogicContext try { preloadData = getConfigPreloadData(preloadId, preloadType); @@ -266,7 +290,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Add operational tree data to SvcLogicContext try { preloadData = getOperationalPreloadData(preloadId, preloadType); @@ -280,7 +303,6 @@ public class OperationsApiController implements OperationsApi { return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); } - // Call DG try { // Any of these can throw a nullpointer exception @@ -295,7 +317,8 @@ public class OperationsApiController implements OperationsApi { if ("200".equals(resp.getResponseCode())) { // If DG returns success, update database String ctxJson = ctxOut.toJsonString("preload-data"); - GenericResourceApiPreloaddataPreloadData preloadToLoad = objectMapper.readValue(ctxJson, GenericResourceApiPreloaddataPreloadData.class); + GenericResourceApiPreloaddataPreloadData preloadToLoad = objectMapper.readValue(ctxJson, + GenericResourceApiPreloaddataPreloadData.class); saveConfigPreloadData(preloadId, preloadType, preloadToLoad); saveOperationalPreloadData(preloadId, preloadType, preloadToLoad); } @@ -318,55 +341,211 @@ public class OperationsApiController implements OperationsApi { resp.setResponseMessage(e.getMessage()); } - retval.setOutput(resp); return (new ResponseEntity<>(retval, HttpStatus.valueOf(Integer.parseInt(resp.getResponseCode())))); } - private boolean hasInvalidPreloadNetwork(GenericResourceApiPreloadnetworktopologyoperationInputBodyparam preloadData) { - return ((preloadData == null) || - (preloadData.getInput() == null) || - (preloadData.getInput().getPreloadNetworkTopologyInformation() == null)); + private boolean hasInvalidPreloadNetwork( + GenericResourceApiPreloadnetworktopologyoperationInputBodyparam preloadData) { + return ((preloadData == null) || (preloadData.getInput() == null) + || (preloadData.getInput().getPreloadNetworkTopologyInformation() == null)); } - private boolean hasInvalidPreloadNetwork(GenericResourceApiPreloadvfmoduletopologyoperationInputBodyparam preloadData) { - return ((preloadData == null) || - (preloadData.getInput() == null) || - (preloadData.getInput().getPreloadVfModuleTopologyInformation() == null)); + + private boolean hasInvalidPreloadNetwork( + GenericResourceApiPreloadvfmoduletopologyoperationInputBodyparam preloadData) { + return ((preloadData == null) || (preloadData.getInput() == null) + || (preloadData.getInput().getPreloadVfModuleTopologyInformation() == null)); } - private GenericResourceApiPreloaddataPreloadData getConfigPreloadData(String preloadId, String preloadType) throws JsonProcessingException { + private boolean hasInvalidServiceId(GenericResourceApiServiceOperationInformation input) { + + return input == null || input.getServiceInformation() == null + || input.getServiceInformation().getServiceInstanceId() == null + || input.getServiceInformation().getServiceInstanceId().length() == 0; + } - List<ConfigPreloadData> configPreloadData = configPreloadDataRepository.findByPreloadIdAndPreloadType(preloadId, preloadType); + private GenericResourceApiPreloaddataPreloadData getConfigPreloadData(String preloadId, String preloadType) + throws JsonProcessingException { + + List<ConfigPreloadData> configPreloadData = configPreloadDataRepository.findByPreloadIdAndPreloadType(preloadId, + preloadType); if (configPreloadData.isEmpty()) { - return(null); + return (null); } else { - return(objectMapper.readValue(configPreloadData.get(0).getPreloadData(), GenericResourceApiPreloaddataPreloadData.class)); + return (objectMapper.readValue(configPreloadData.get(0).getPreloadData(), + GenericResourceApiPreloaddataPreloadData.class)); } } - private GenericResourceApiPreloaddataPreloadData getOperationalPreloadData(String preloadId, String preloadType) throws JsonProcessingException { + private GenericResourceApiPreloaddataPreloadData getOperationalPreloadData(String preloadId, String preloadType) + throws JsonProcessingException { - List<OperationalPreloadData> configPreloadData = operationalPreloadDataRepository.findByPreloadIdAndPreloadType(preloadId, preloadType); + List<OperationalPreloadData> configPreloadData = operationalPreloadDataRepository + .findByPreloadIdAndPreloadType(preloadId, preloadType); if (configPreloadData.isEmpty()) { - return(null); + return (null); } else { - return(objectMapper.readValue(configPreloadData.get(0).getPreloadData(), GenericResourceApiPreloaddataPreloadData.class)); + return (objectMapper.readValue(configPreloadData.get(0).getPreloadData(), + GenericResourceApiPreloaddataPreloadData.class)); } } - private void saveConfigPreloadData(String preloadId, String preloadType, GenericResourceApiPreloaddataPreloadData preloadData) throws JsonProcessingException { + private void saveConfigPreloadData(String preloadId, String preloadType, + GenericResourceApiPreloaddataPreloadData preloadData) throws JsonProcessingException { configPreloadDataRepository.deleteByPreloadIdAndPreloadType(preloadId, preloadType); - configPreloadDataRepository.save(new ConfigPreloadData(preloadId, preloadType, objectMapper.writeValueAsString(preloadData))); + configPreloadDataRepository + .save(new ConfigPreloadData(preloadId, preloadType, objectMapper.writeValueAsString(preloadData))); } - private void saveOperationalPreloadData(String preloadId, String preloadType, GenericResourceApiPreloaddataPreloadData preloadData) throws JsonProcessingException { + private void saveOperationalPreloadData(String preloadId, String preloadType, + GenericResourceApiPreloaddataPreloadData preloadData) throws JsonProcessingException { operationalPreloadDataRepository.deleteByPreloadIdAndPreloadType(preloadId, preloadType); - operationalPreloadDataRepository.save(new OperationalPreloadData(preloadId, preloadType, objectMapper.writeValueAsString(preloadData))); + operationalPreloadDataRepository + .save(new OperationalPreloadData(preloadId, preloadType, objectMapper.writeValueAsString(preloadData))); + + } + + private GenericResourceApiServicedataServiceData getConfigServiceData(String svcInstanceId) throws JsonProcessingException { + + List<ConfigServices> configServices = configServicesRepository.findBySvcInstanceId(svcInstanceId); + + if (configServices.isEmpty()) { + return (null); + } else { + return (objectMapper.readValue(configServices.get(0).getSvcData(), + GenericResourceApiServicedataServiceData.class)); + } + } + + + @Override + public ResponseEntity<GenericResourceApiNetworkTopologyOperation> operationsGENERICRESOURCEAPInetworkTopologyOperationPost( + @Valid GenericResourceApiNetworkOperationInformationBodyparam genericResourceApiNetworkOperationInformationBodyParam) + throws RestException { + // TODO Auto-generated method stub + return OperationsApi.super.operationsGENERICRESOURCEAPInetworkTopologyOperationPost( + genericResourceApiNetworkOperationInformationBodyParam); + } + + @Override + public ResponseEntity<GenericResourceApiServiceTopologyOperation> operationsGENERICRESOURCEAPIserviceTopologyOperationPost( + @Valid GenericResourceApiServiceOperationInformationBodyparam input) throws RestException { + final String svcOperation = "service-topology-operation"; + GenericResourceApiServiceTopologyOperation retval = new GenericResourceApiServiceTopologyOperation(); + GenericResourceApiServicetopologyoperationOutput resp = new GenericResourceApiServicetopologyoperationOutput(); + + log.info(CALLED_STR, svcOperation); + + // Verify input contains service instance id + if (hasInvalidServiceId(input.getInput())) { + log.debug("exiting {} because of null or empty service-instance-id", svcOperation); + + resp.setResponseCode("404"); + resp.setResponseMessage("null or empty service-instance-id"); + resp.setAckFinalIndicator("Y"); + + retval.setOutput(resp); + + return new ResponseEntity<>(retval, HttpStatus.OK); + } + + String svcInstanceId = input.getInput().getServiceInformation().getServiceInstanceId(); + + SvcLogicContext ctxIn = new SvcLogicContext(); + + // Add input to SvcLogicContext + try { + ctxIn.mergeJson(svcOperation + "-input", objectMapper.writeValueAsString(input.getInput())); + } catch (JsonProcessingException e) { + log.error("exiting {} due to parse error on input data", svcOperation); + resp.setResponseCode("500"); + resp.setResponseMessage("internal error"); + resp.setAckFinalIndicator("Y"); + retval.setOutput(resp); + return new ResponseEntity<>(retval, HttpStatus.INTERNAL_SERVER_ERROR); + } + + // Add config tree data to SvcLogicContext + List<ConfigServices> configServices = configServicesRepository.findBySvcInstanceId(svcInstanceId); + ConfigServices configService = null; + if (configServices != null && !configServices.isEmpty()) { + configService = configServices.get(0); + ctxIn.mergeJson("service-data", configService.getSvcData()); + } else { + configService = new ConfigServices(svcInstanceId, null); + } + + // Add operational tree data to SvcLogicContext + List<OperationalServices> operServices = operationalServicesRepository.findBySvcInstanceId(svcInstanceId); + OperationalServices operService = null; + boolean saveOperationalData = false; + + if (operServices != null && !operServices.isEmpty()) { + operService = operServices.get(0); + ctxIn.mergeJson("operational-data", operService.getSvcData()); + } else { + operService = new OperationalServices(svcInstanceId, null, null); + } + + // Update service status info in config entry from input + configService.setServiceStatusAction(input.getInput().getRequestInformation().getRequestAction().toString()); + configService.setServiceStatusRpcAction(input.getInput().getSdncRequestHeader().getSvcAction().toString()); + configService.setServiceStatusRpcName(svcOperation); + + + // Call DG + try { + // Any of these can throw a nullpointer exception + // execute should only throw a SvcLogicException + SvcLogicContext ctxOut = svc.execute(MODULE_NAME, svcOperation, null, "sync", ctxIn); + Properties respProps = ctxOut.toProperties(); + + resp.setAckFinalIndicator(respProps.getProperty("ack-final-indicator", "Y")); + resp.setResponseCode(respProps.getProperty("error-code", "200")); + resp.setResponseMessage(respProps.getProperty("error-message", "SUCCESS")); + configService.setServiceStatusRequestStatus(GenericResourceApiRequestStatusEnumeration.SYNCCOMPLETE.toString()); + + if ("200".equals(resp.getResponseCode())) { + // If DG returns success, update svcData in config and operational trees + // and remember to save operational data. + String ctxJson = ctxOut.toJsonString("service-data"); + configService.setSvcData(ctxJson); + operService.setSvcData(ctxJson); + saveOperationalData = true; + } + + } catch (NullPointerException npe) { + resp.setAckFinalIndicator("true"); + resp.setResponseCode("500"); + resp.setResponseMessage("Check that you populated module, rpc and or mode correctly."); + } catch (SvcLogicException e) { + resp.setAckFinalIndicator("true"); + resp.setResponseCode("500"); + resp.setResponseMessage(e.getMessage()); + } + + // Update status in config services entry + + configService.setServiceStatusFinalIndicator(resp.getAckFinalIndicator()); + configService.setServiceStatusResponseCode(resp.getResponseCode()); + configService.setServiceStatusResponseMessage(resp.getResponseMessage()); + configService.setServiceStatusResponseTimestamp(Iso8601Util.now()); + + // Update config tree + configServicesRepository.save(configService); + + // If necessary, sync status to operation service entry and save + if (saveOperationalData) { + operService.setServiceStatus(configService.getServiceStatus()); + operationalServicesRepository.save(operService); + } + retval.setOutput(resp); + return (new ResponseEntity<>(retval, HttpStatus.OK)); } diff --git a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/data/OperationalServices.java b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/data/OperationalServices.java index aab5246..c1d361d 100644 --- a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/data/OperationalServices.java +++ b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/data/OperationalServices.java @@ -147,7 +147,10 @@ public class OperationalServices { public void setServiceStatus(GenericResourceApiServicestatusServiceStatus serviceStatus) { this.serviceStatusAction = serviceStatus.getAction(); this.serviceStatusFinalIndicator = serviceStatus.getFinalIndicator(); - this.serviceStatusRequestStatus = serviceStatus.getRequestStatus().toString(); + if (serviceStatus.getRequestStatus() != null) { + this.serviceStatusRequestStatus = serviceStatus.getRequestStatus().toString(); + } + this.serviceStatusResponseCode = serviceStatus.getResponseCode(); this.serviceStatusResponseMessage = serviceStatus.getResponseMessage(); this.serviceStatusResponseTimestamp = serviceStatus.getResponseTimestamp(); diff --git a/ms/generic-resource-api/src/main/resources/application.properties b/ms/generic-resource-api/src/main/resources/application.properties index 1c1b867..ac4ed2f 100644 --- a/ms/generic-resource-api/src/main/resources/application.properties +++ b/ms/generic-resource-api/src/main/resources/application.properties @@ -9,6 +9,7 @@ spring.datasource.url=jdbc:mariadb://${MYSQL_DB_HOST}:3306/sdnctl spring.datasource.username=sdnc spring.datasource.password=abc123 spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.datasource.platform=mariadb spring.datasource.testWhileIdle=true spring.datasource.validationQuery=SELECT 1 spring.jpa.show-sql=true @@ -17,4 +18,4 @@ spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.Im # spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl -spring.jpa.database=mysql
\ No newline at end of file +spring.jpa.database=mysql diff --git a/ms/generic-resource-api/src/main/resources/schema-derby.sql b/ms/generic-resource-api/src/main/resources/schema-derby.sql index b98b4ad..2ff2d15 100644 --- a/ms/generic-resource-api/src/main/resources/schema-derby.sql +++ b/ms/generic-resource-api/src/main/resources/schema-derby.sql @@ -1,2764 +1,2672 @@ +CREATE SCHEMA sdnctl; + +SET SCHEMA sdnctl; -- --- Table structure for table `ACCESS_LOG` +-- Table structure for table ACCESS_LOG -- -CREATE TABLE `ACCESS_LOG` ( - `access_log_seq` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `method` varchar(12) DEFAULT NULL, - `version` varchar(12) DEFAULT NULL, - `status` varchar(12) DEFAULT NULL, - `url` varchar(256) DEFAULT NULL, - `remote_address` varchar(128) DEFAULT NULL, - PRIMARY KEY (`access_log_seq`) -) ENGINE=InnoDB AUTO_INCREMENT=1034 DEFAULT CHARSET=latin1; +CREATE TABLE ACCESS_LOG ( + access_log_seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + method varchar(12) DEFAULT NULL, + version varchar(12) DEFAULT NULL, + status varchar(12) DEFAULT NULL, + url varchar(256) DEFAULT NULL, + remote_address varchar(128) DEFAULT NULL, + PRIMARY KEY (access_log_seq) +) ; -- --- Table structure for table `CUSTOMER` +-- Table structure for table CUSTOMER -- -CREATE TABLE `CUSTOMER` ( - `cust_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_name` varchar(256) DEFAULT NULL, - `grua` varchar(4) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`cust_id`), - UNIQUE KEY `IU1_CUSTOMER` (`customer_name`) -) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=latin1; +CREATE TABLE CUSTOMER ( + cust_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + customer_name varchar(256) DEFAULT NULL, + grua varchar(4) NOT NULL, + create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (cust_id) +) ; + + +-- +-- Table structure for table ADDRESS_PLAN_POLICIES +-- +CREATE TABLE ADDRESS_PLAN_POLICIES ( + key_name varchar(255) NOT NULL, + key_value_source_type varchar(255) NOT NULL, + key_value_source varchar(255) NOT NULL, + PRIMARY KEY (key_name) +) ; -- --- Table structure for table `ADDRESS_PLAN_POLICIES` +-- Table structure for table AGNOSTIC_NOTIFICATION_URL -- -CREATE TABLE `ADDRESS_PLAN_POLICIES` ( - `key_name` varchar(255) NOT NULL, - `key_value_source_type` varchar(255) NOT NULL, - `key_value_source` varchar(255) NOT NULL, - PRIMARY KEY (`key_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE AGNOSTIC_NOTIFICATION_URL ( + service_type varchar(128) NOT NULL, + service_instance_id varchar(128) NOT NULL, + request_id varchar(128) NOT NULL, + svc_notification_url varchar(256) NOT NULL, + PRIMARY KEY (service_type,service_instance_id,request_id) +) ; + -- --- Table structure for table `AGNOSTIC_NOTIFICATION_URL` +-- Table structure for table AGNOSTIC_TO_SVC_SPCFC_API -- +CREATE TABLE AGNOSTIC_TO_SVC_SPCFC_API ( + operation varchar(128) NOT NULL, + service varchar(128) NOT NULL, + service_specific_api varchar(128) NOT NULL, + async_process varchar(15) DEFAULT NULL, + PRIMARY KEY (operation,service) +) ; -CREATE TABLE `AGNOSTIC_NOTIFICATION_URL` ( - `service_type` varchar(128) NOT NULL, - `service_instance_id` varchar(128) NOT NULL, - `request_id` varchar(128) NOT NULL, - `svc_notification_url` varchar(256) NOT NULL, - PRIMARY KEY (`service_type`,`service_instance_id`,`request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- +-- Table structure for table AIC_AVAIL_ZONE_POOL +-- +CREATE TABLE AIC_AVAIL_ZONE_POOL ( + aic_site_id varchar(100) NOT NULL, + status varchar(40) NOT NULL, + availability_zone varchar(100) NOT NULL, + token varchar(5) NOT NULL, + vnf_id varchar(80) DEFAULT NULL, + service_type varchar(100) NOT NULL, + vnf_type varchar(20) DEFAULT NULL, + hypervisor varchar(10) DEFAULT NULL, + PRIMARY KEY (aic_site_id,availability_zone,token) +) ; +-- +-- Table structure for table AIC_HOSTNAME +-- +CREATE TABLE AIC_HOSTNAME ( + hostname varchar(20) NOT NULL, + cust_id int NOT NULL, + vendor_code varchar(1) NOT NULL, + virtual_device_type varchar(2) DEFAULT NULL, + device_sequence varchar(3) NOT NULL, + create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (hostname) +) ; -- --- Table structure for table `AGNOSTIC_TO_SVC_SPCFC_API` +-- Table structure for table AIC_NETWORK -- -CREATE TABLE `AGNOSTIC_TO_SVC_SPCFC_API` ( - `operation` varchar(128) NOT NULL, - `service` varchar(128) NOT NULL, - `service_specific_api` varchar(128) NOT NULL, - `async_process` varchar(15) DEFAULT NULL, - PRIMARY KEY (`operation`,`service`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE AIC_NETWORK ( + network_id varchar(100) NOT NULL, + network_name varchar(100) DEFAULT NULL, + status varchar(20) DEFAULT NULL, + tenant_id varchar(100) DEFAULT NULL, + switch_uuid varchar(100) DEFAULT NULL, + portgroup_name varchar(100) DEFAULT NULL, + portgroup_id varchar(100) DEFAULT NULL, + PRIMARY KEY (network_id) +) ; + +-- +-- Table structure for table AIC_SITE +-- + +CREATE TABLE AIC_SITE ( + name varchar(100) DEFAULT NULL, + aic_site_id varchar(100) NOT NULL, + vcenter_url varchar(200) DEFAULT NULL, + vcenter_username varchar(40) DEFAULT NULL, + vcenter_passwd varchar(255) for bit data DEFAULT NULL, + city varchar(100) DEFAULT NULL, + state varchar(2) DEFAULT NULL, + operational_status varchar(20) DEFAULT NULL, + oam_gateway_addr varchar(20) DEFAULT '', + PRIMARY KEY (aic_site_id) +) ; + +-- +-- Table structure for table AIC_SWITCH +-- + +CREATE TABLE AIC_SWITCH ( + switch_name varchar(100) DEFAULT NULL, + physical_network_name varchar(100) NOT NULL, + aic_site_id varchar(100) DEFAULT NULL, + uuid varchar(100) DEFAULT NULL, + availability_zone varchar(100) DEFAULT NULL, + PRIMARY KEY (physical_network_name) +) ; -- --- Table structure for table `AIC_AVAIL_ZONE_POOL` +-- Table structure for table AIC_ZONE_CLOUD_REGION_ID -- -CREATE TABLE `AIC_AVAIL_ZONE_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `status` varchar(40) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `token` varchar(5) NOT NULL, - `vnf_id` varchar(80) DEFAULT NULL, - `service_type` varchar(100) NOT NULL, - `vnf_type` varchar(20) DEFAULT NULL, - `hypervisor` varchar(10) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE AIC_ZONE_CLOUD_REGION_ID ( + zone_region_id varchar(255) NOT NULL, + cilli_code varchar(255) NOT NULL, + location_id varchar(255) NOT NULL DEFAULT '', + city_state_country varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (zone_region_id,cilli_code,location_id,city_state_country) +) ; -- --- Table structure for table `AIC_HOSTNAME` +-- Table structure for table ALLOCATION_ITEM -- -CREATE TABLE `AIC_HOSTNAME` ( - `hostname` varchar(20) NOT NULL, - `cust_id` int(11) NOT NULL, - `vendor_code` varchar(1) NOT NULL, - `virtual_device_type` varchar(2) DEFAULT NULL, - `device_sequence` varchar(3) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`hostname`), - UNIQUE KEY `hostname` (`hostname`), - KEY `IN1_AIC_HOSTNAME` (`cust_id`), - CONSTRAINT `AC1_HOSTNAME` FOREIGN KEY (`cust_id`) REFERENCES `CUSTOMER` (`cust_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE ALLOCATION_ITEM ( + allocation_item_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + resource_id bigint NOT NULL, + application_id varchar(50) NOT NULL, + resource_set_id varchar(200) NOT NULL, + resource_union_id varchar(200) NOT NULL, + resource_share_group_list varchar(200) DEFAULT NULL, + lt_used bigint DEFAULT NULL, + ll_label varchar(50) DEFAULT NULL, + rr_used varchar(200) DEFAULT NULL, + allocation_time timestamp NOT NULL, + PRIMARY KEY (allocation_item_id) +) ; + +-- +-- Table structure for table ALLOTTED_RESOURCE_MODEL +-- + +CREATE TABLE ALLOTTED_RESOURCE_MODEL ( + customization_uuid varchar(255) NOT NULL, + model_yaml blob, + invariant_uuid varchar(255) DEFAULT NULL, + uuid varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + naming_policy varchar(255) DEFAULT NULL, + ecomp_generated_naming char(1) DEFAULT NULL, + depending_service varchar(255) DEFAULT NULL, + role varchar(255) DEFAULT NULL, + type varchar(255) DEFAULT NULL, + service_dependency varchar(255) DEFAULT NULL, + allotted_resource_type varchar(255) DEFAULT NULL, + PRIMARY KEY (customization_uuid) +) ; -- --- Table structure for table `AIC_NETWORK` +-- Table structure for table ALTS_CREDENTIALS -- -CREATE TABLE `AIC_NETWORK` ( - `network_id` varchar(100) NOT NULL, - `network_name` varchar(100) DEFAULT NULL, - `status` varchar(20) DEFAULT NULL, - `tenant_id` varchar(100) DEFAULT NULL, - `switch_uuid` varchar(100) DEFAULT NULL, - `portgroup_name` varchar(100) DEFAULT NULL, - `portgroup_id` varchar(100) DEFAULT NULL, - PRIMARY KEY (`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE ALTS_CREDENTIALS ( + alts_username varchar(255) NOT NULL, + alts_password varchar(255) for bit data NOT NULL, + PRIMARY KEY (alts_username) +) ; -- --- Table structure for table `AIC_SITE` +-- Table structure for table ASDC_ARTIFACTS -- -CREATE TABLE `AIC_SITE` ( - `name` varchar(100) DEFAULT NULL, - `aic_site_id` varchar(100) NOT NULL, - `vcenter_url` varchar(200) DEFAULT NULL, - `vcenter_username` varchar(40) DEFAULT NULL, - `vcenter_passwd` varbinary(255) DEFAULT NULL, - `city` varchar(100) DEFAULT NULL, - `state` varchar(2) DEFAULT NULL, - `operational_status` varchar(20) DEFAULT NULL, - `oam_gateway_addr` varchar(20) DEFAULT '', - PRIMARY KEY (`aic_site_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE ASDC_ARTIFACTS ( + asdc_artifacts_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_uuid varchar(50) DEFAULT NULL, + distribution_id varchar(50) DEFAULT NULL, + service_name varchar(255) DEFAULT NULL, + service_description varchar(255) DEFAULT NULL, + resource_uuid varchar(255) DEFAULT NULL, + resource_instance_name varchar(255) DEFAULT NULL, + resource_name varchar(255) DEFAULT NULL, + resource_version varchar(50) DEFAULT NULL, + resource_type varchar(50) DEFAULT NULL, + artifact_uuid varchar(50) DEFAULT NULL, + artifact_type varchar(50) DEFAULT NULL, + artifact_version varchar(25) DEFAULT NULL, + artifact_description varchar(255) DEFAULT NULL, + internal_version int DEFAULT NULL, + creation_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + artifact_name varchar(255) DEFAULT NULL, + artifact_content long varchar, + PRIMARY KEY (asdc_artifacts_id) +) ; -- --- Table structure for table `AIC_SWITCH` +-- Table structure for table ASDC_REFERENCE -- -CREATE TABLE `AIC_SWITCH` ( - `switch_name` varchar(100) DEFAULT NULL, - `physical_network_name` varchar(100) NOT NULL, - `aic_site_id` varchar(100) DEFAULT NULL, - `uuid` varchar(100) DEFAULT NULL, - `availability_zone` varchar(100) DEFAULT NULL, - PRIMARY KEY (`physical_network_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE ASDC_REFERENCE ( + asdc_reference_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_type varchar(50) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + vnfc_type varchar(50) DEFAULT NULL, + file_category varchar(50) DEFAULT NULL, + action varchar(50) DEFAULT NULL, + artifact_type varchar(50) DEFAULT NULL, + artifact_name varchar(255) NOT NULL, + PRIMARY KEY (asdc_reference_id) +) ; --- --- Table structure for table `AIC_ZONE_CLOUD_REGION_ID` --- - -CREATE TABLE `AIC_ZONE_CLOUD_REGION_ID` ( - `zone_region_id` varchar(255) NOT NULL, - `cilli_code` varchar(255) NOT NULL, - `location_id` varchar(255) NOT NULL DEFAULT '', - `city_state_country` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`zone_region_id`,`cilli_code`,`location_id`,`city_state_country`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- --- Table structure for table `ALLOCATION_ITEM` --- - -CREATE TABLE `ALLOCATION_ITEM` ( - `allocation_item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_id` bigint(20) NOT NULL, - `application_id` varchar(50) NOT NULL, - `resource_set_id` varchar(200) NOT NULL, - `resource_union_id` varchar(200) NOT NULL, - `resource_share_group_list` varchar(200) DEFAULT NULL, - `lt_used` bigint(20) DEFAULT NULL, - `ll_label` varchar(50) DEFAULT NULL, - `rr_used` varchar(200) DEFAULT NULL, - `allocation_time` datetime NOT NULL, - PRIMARY KEY (`allocation_item_id`), - UNIQUE KEY `allocation_item_id` (`allocation_item_id`), - UNIQUE KEY `IX2_ALLOCATION_ITEM` (`resource_id`,`resource_set_id`), - KEY `IX1_ALLOCATION_ITEM` (`resource_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5764 DEFAULT CHARSET=latin1; - --- --- Table structure for table `ALLOTTED_RESOURCE_MODEL` --- - -CREATE TABLE `ALLOTTED_RESOURCE_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `depending_service` varchar(255) DEFAULT NULL, - `role` varchar(255) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `service_dependency` varchar(255) DEFAULT NULL, - `allotted_resource_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- Table structure for table BLOB_TEST +-- + +CREATE TABLE BLOB_TEST ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + odl varchar(20) DEFAULT NULL, + communities blob, + status varchar(10) NOT NULL DEFAULT 'NEW' CONSTRAINT status_ck_1 CHECK(status IN ('NEW', 'COMPLETE', 'FAILED')), + retry_count int DEFAULT -1, + PRIMARY KEY (seq) +) ; + +-- +-- Table structure for table CAPABILITY +-- + +CREATE TABLE CAPABILITY ( + capability_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + capability_name varchar(50) NOT NULL, + implementation_name varchar(100) NOT NULL, + operation_name varchar(50) NOT NULL, + operation_description varchar(100) NOT NULL, + input_definition long varchar, + output_definition long varchar, + dependency_definition long varchar, + tags varchar(100) DEFAULT NULL, + PRIMARY KEY (capability_id) +) ; + +-- +-- Table structure for table CITY_CODE +-- + +CREATE TABLE CITY_CODE ( + city_code_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + city_code varchar(3) NOT NULL, + city varchar(150) NOT NULL, + state varchar(10) NOT NULL, + country_code varchar(10) NOT NULL, + PRIMARY KEY (city_code_id) +) ; -- --- Table structure for table `ALTS_CREDENTIALS` +-- Table structure for table CLI_UPDATES -- -CREATE TABLE `ALTS_CREDENTIALS` ( - `alts_username` varchar(255) NOT NULL, - `alts_password` varbinary(255) NOT NULL, - PRIMARY KEY (`alts_username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `ASDC_ARTIFACTS` --- +CREATE TABLE CLI_UPDATES ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + status varchar(10) NOT NULL DEFAULT 'NEW' CONSTRAINT status_ck_2 CHECK(status IN ('NEW', 'COMPLETE', 'FAILED')), + create_timestamp timestamp DEFAULT CURRENT_TIMESTAMP, + last_processed_timestamp timestamp DEFAULT CURRENT_TIMESTAMP, + target_address varchar(128) DEFAULT NULL, + cli_text varchar(128) DEFAULT NULL, + PRIMARY KEY (seq) +) ; -CREATE TABLE `ASDC_ARTIFACTS` ( - `asdc_artifacts_id` int(11) NOT NULL AUTO_INCREMENT, - `service_uuid` varchar(50) DEFAULT NULL, - `distribution_id` varchar(50) DEFAULT NULL, - `service_name` varchar(255) DEFAULT NULL, - `service_description` varchar(255) DEFAULT NULL, - `resource_uuid` varchar(255) DEFAULT NULL, - `resource_instance_name` varchar(255) DEFAULT NULL, - `resource_name` varchar(255) DEFAULT NULL, - `resource_version` varchar(50) DEFAULT NULL, - `resource_type` varchar(50) DEFAULT NULL, - `artifact_uuid` varchar(50) DEFAULT NULL, - `artifact_type` varchar(50) DEFAULT NULL, - `artifact_version` varchar(25) DEFAULT NULL, - `artifact_description` varchar(255) DEFAULT NULL, - `internal_version` int(11) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `artifact_name` varchar(255) DEFAULT NULL, - `artifact_content` longtext, - PRIMARY KEY (`asdc_artifacts_id`), - UNIQUE KEY `asdc_artifacts_id` (`asdc_artifacts_id`) -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; - --- --- Table structure for table `ASDC_REFERENCE` --- - -CREATE TABLE `ASDC_REFERENCE` ( - `asdc_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `service_type` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `file_category` varchar(50) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `artifact_type` varchar(50) DEFAULT NULL, - `artifact_name` varchar(255) NOT NULL, - PRIMARY KEY (`asdc_reference_id`), - UNIQUE KEY `asdc_reference_id` (`asdc_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `BLOB_TEST` +-- +-- Table structure for table CONFIGFILES -- -CREATE TABLE `BLOB_TEST` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `odl` varchar(20) DEFAULT NULL, - `communities` mediumblob, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `retry_count` int(11) DEFAULT '-1', - PRIMARY KEY (`seq`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `CAPABILITY` --- - -CREATE TABLE `CAPABILITY` ( - `capability_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_name` varchar(50) NOT NULL, - `implementation_name` varchar(100) NOT NULL, - `operation_name` varchar(50) NOT NULL, - `operation_description` varchar(100) NOT NULL, - `input_definition` longtext, - `output_definition` longtext, - `dependency_definition` longtext, - `tags` varchar(100) DEFAULT NULL, - PRIMARY KEY (`capability_id`), - UNIQUE KEY `capability_id` (`capability_name`) -) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CITY_CODE` --- - -CREATE TABLE `CITY_CODE` ( - `city_code_id` int(11) NOT NULL AUTO_INCREMENT, - `city_code` varchar(3) NOT NULL, - `city` varchar(150) NOT NULL, - `state` varchar(10) NOT NULL, - `country_code` varchar(10) NOT NULL, - PRIMARY KEY (`city_code_id`), - KEY `IN1_CITY_CODE` (`city`,`state`,`country_code`) -) ENGINE=InnoDB AUTO_INCREMENT=37822 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CLI_UPDATES` --- - -CREATE TABLE `CLI_UPDATES` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `create_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `last_processed_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `target_address` varchar(128) DEFAULT NULL, - `cli_text` varchar(128) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `CONFIGFILES` --- - -CREATE TABLE `CONFIGFILES` ( - `config_file_id` int(11) NOT NULL AUTO_INCREMENT, - `external_version` varchar(50) DEFAULT NULL, - `data_source` varchar(25) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `service_instance_id` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `file_category` varchar(50) DEFAULT NULL, - `file_name` varchar(255) DEFAULT NULL, - `file_content` longtext, - `action` varchar(50) DEFAULT NULL, - `vnf_id` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`config_file_id`), - UNIQUE KEY `config_file_id` (`config_file_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; +CREATE TABLE CONFIGFILES ( + config_file_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + external_version varchar(50) DEFAULT NULL, + data_source varchar(25) DEFAULT NULL, + creation_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + service_instance_id varchar(50) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + vnfc_type varchar(50) DEFAULT NULL, + file_category varchar(50) DEFAULT NULL, + file_name varchar(255) DEFAULT NULL, + file_content long varchar, + action varchar(50) DEFAULT NULL, + vnf_id varchar(50) DEFAULT NULL, + vm_name varchar(50) DEFAULT NULL, + vnf_name varchar(50) DEFAULT NULL, + PRIMARY KEY (config_file_id) +) ; -- --- Table structure for table `CONFIGURE_ACTION_DG` +-- Table structure for table CONFIGURE_ACTION_DG -- -CREATE TABLE `CONFIGURE_ACTION_DG` ( - `configure_action_dg_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `init_config_dg` varchar(50) DEFAULT NULL, - `generate_config_dg` varchar(50) DEFAULT NULL, - `download_config_dg` varchar(50) DEFAULT NULL, - PRIMARY KEY (`configure_action_dg_id`), - UNIQUE KEY `configure_action_dg_id` (`configure_action_dg_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +CREATE TABLE CONFIGURE_ACTION_DG ( + configure_action_dg_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vnf_type varchar(50) DEFAULT NULL, + action varchar(50) DEFAULT NULL, + init_config_dg varchar(50) DEFAULT NULL, + generate_config_dg varchar(50) DEFAULT NULL, + download_config_dg varchar(50) DEFAULT NULL, + PRIMARY KEY (configure_action_dg_id) +) ; -- --- Table structure for table `CONFIG_CONTENT` +-- Table structure for table CONFIG_CONTENT -- -CREATE TABLE `CONFIG_CONTENT` ( - `config_content_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` varchar(50) NOT NULL, - `content_type` varchar(50) NOT NULL, - `template_name` varchar(50) DEFAULT NULL, - `originator_id` varchar(50) DEFAULT NULL, - `service_description` varchar(100) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `service_type` varchar(50) DEFAULT NULL, - `service_instance_id` varchar(50) DEFAULT NULL, - `vnf_id` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `host_ip_address` varchar(50) DEFAULT NULL, - `config_indicator` varchar(25) DEFAULT NULL, - `pending_delete` varchar(1) DEFAULT NULL, - `content` longtext, - PRIMARY KEY (`config_content_id`), - UNIQUE KEY `config_content_id` (`creation_date`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE CONFIG_CONTENT ( + config_content_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_id varchar(50) NOT NULL, + content_type varchar(50) NOT NULL, + template_name varchar(50) DEFAULT NULL, + originator_id varchar(50) DEFAULT NULL, + service_description varchar(100) DEFAULT NULL, + action varchar(50) DEFAULT NULL, + creation_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + service_type varchar(50) DEFAULT NULL, + service_instance_id varchar(50) DEFAULT NULL, + vnf_id varchar(50) DEFAULT NULL, + vnf_name varchar(50) DEFAULT NULL, + vm_name varchar(50) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + vnfc_type varchar(50) DEFAULT NULL, + host_ip_address varchar(50) DEFAULT NULL, + config_indicator varchar(25) DEFAULT NULL, + pending_delete varchar(1) DEFAULT NULL, + content long varchar, + PRIMARY KEY (config_content_id) +) ; -- --- Table structure for table `CONFIG_FILE_REFERENCE` +-- Table structure for table CONFIG_FILE_REFERENCE -- -CREATE TABLE `CONFIG_FILE_REFERENCE` ( - `config_file_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `site_location` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `import_type` varchar(50) DEFAULT NULL, - `file_type` varchar(50) DEFAULT NULL, - `source_server_name` varchar(255) DEFAULT NULL, - `source_file_path` varchar(255) DEFAULT NULL, - `target_file_path` varchar(255) DEFAULT NULL, - `name` varchar(50) DEFAULT NULL, - `file_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`config_file_reference_id`), - UNIQUE KEY `config_file_reference_id` (`config_file_reference_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE CONFIG_FILE_REFERENCE ( + config_file_reference_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + site_location varchar(50) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + import_type varchar(50) DEFAULT NULL, + file_type varchar(50) DEFAULT NULL, + source_server_name varchar(255) DEFAULT NULL, + source_file_path varchar(255) DEFAULT NULL, + target_file_path varchar(255) DEFAULT NULL, + name varchar(50) DEFAULT NULL, + file_name varchar(255) DEFAULT NULL, + PRIMARY KEY (config_file_reference_id) +) ; -- --- Table structure for table `CONFIG_TRANSACTION_LOG` +-- Table structure for table CONFIG_TRANSACTION_LOG -- -CREATE TABLE `CONFIG_TRANSACTION_LOG` ( - `config_transaction_log_id` varchar(50) NOT NULL, - `request_id` varchar(50) DEFAULT NULL, - `message_type` varchar(100) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `message` longtext, - PRIMARY KEY (`config_transaction_log_id`), - UNIQUE KEY `config_transaction_log_id` (`config_transaction_log_id`) -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; +CREATE TABLE CONFIG_TRANSACTION_LOG ( + config_transaction_log_id varchar(50) NOT NULL, + request_id varchar(50) DEFAULT NULL, + message_type varchar(100) DEFAULT NULL, + creation_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + message long varchar, + PRIMARY KEY (config_transaction_log_id) +) ; -- --- Table structure for table `COUNTRY_ASN_MAPPING` +-- Table structure for table COUNTRY_ASN_MAPPING -- -CREATE TABLE `COUNTRY_ASN_MAPPING` ( - `asn` int(5) NOT NULL, - `iso_2char` varchar(5) NOT NULL, - `iso_3char` varchar(5) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE COUNTRY_ASN_MAPPING ( + asn int NOT NULL, + iso_2char varchar(5) NOT NULL, + iso_3char varchar(5) NOT NULL +) ; -- --- Table structure for table `CUSTOMER2CONNECTION_MAPPING` +-- Table structure for table CUSTOMER2CONNECTION_MAPPING -- -CREATE TABLE `CUSTOMER2CONNECTION_MAPPING` ( - `customer2connection_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `service_type` varchar(30) DEFAULT NULL, - `connection_id` varchar(100) NOT NULL, - `status` varchar(20) DEFAULT NULL, - PRIMARY KEY (`customer2connection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; +CREATE TABLE CUSTOMER2CONNECTION_MAPPING ( + customer2connection_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_instance_id varchar(80) NOT NULL, + instance_type varchar(20) NOT NULL, + originating_service_instance_id varchar(80) DEFAULT NULL, + originating_service_type varchar(20) DEFAULT NULL, + service_type varchar(30) DEFAULT NULL, + connection_id varchar(100) NOT NULL, + status varchar(20) DEFAULT NULL, + PRIMARY KEY (customer2connection_id) +) ; -- --- Table structure for table `CUSTOMER2CONNECTION_MAPPING_NEW` +-- Table structure for table CUSTOMER2CONNECTION_MAPPING_NEW -- -CREATE TABLE `CUSTOMER2CONNECTION_MAPPING_NEW` ( - `customer2connection_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `service_type` varchar(30) DEFAULT NULL, - `connection_id` varchar(100) NOT NULL, - `status` varchar(100) DEFAULT NULL, - PRIMARY KEY (`customer2connection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE CUSTOMER2CONNECTION_MAPPING_NEW ( + customer2connection_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_instance_id varchar(80) NOT NULL, + instance_type varchar(20) NOT NULL, + originating_service_instance_id varchar(80) DEFAULT NULL, + originating_service_type varchar(20) DEFAULT NULL, + service_type varchar(30) DEFAULT NULL, + connection_id varchar(100) NOT NULL, + status varchar(100) DEFAULT NULL, + PRIMARY KEY (customer2connection_id) +) ; -- --- Table structure for table `DATA_OBJECT_MAPPING` +-- Table structure for table DATA_OBJECT_MAPPING -- -CREATE TABLE `DATA_OBJECT_MAPPING` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `data_object_key` varchar(100) NOT NULL, - `data_object_type` varchar(50) NOT NULL, - `service_type` varchar(50) NOT NULL, - `data_object_key2` varchar(100) NOT NULL, - `data_object_key2_type` varchar(50) NOT NULL, - `data_object_key3` varchar(100) DEFAULT NULL, - `data_object_key3_type` varchar(50) DEFAULT NULL, - `service` varchar(50) DEFAULT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DATA_OBJECT_MAPPING` (`data_object_key`,`data_object_type`,`service_type`), - KEY `IX2_DATA_OBJECT_MAPPING` (`service_type`,`data_object_key2`,`data_object_key2_type`) -) ENGINE=InnoDB AUTO_INCREMENT=3211 DEFAULT CHARSET=latin1; +CREATE TABLE DATA_OBJECT_MAPPING ( + serial_key int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + data_object_key varchar(100) NOT NULL, + data_object_type varchar(50) NOT NULL, + service_type varchar(50) NOT NULL, + data_object_key2 varchar(100) NOT NULL, + data_object_key2_type varchar(50) NOT NULL, + data_object_key3 varchar(100) DEFAULT NULL, + data_object_key3_type varchar(50) DEFAULT NULL, + service varchar(50) DEFAULT NULL, + PRIMARY KEY (serial_key) +) ; -- --- Table structure for table `DEVICE2CONNECTION_MAPPING` +-- Table structure for table DEVICE2CONNECTION_MAPPING -- -CREATE TABLE `DEVICE2CONNECTION_MAPPING` ( - `vnf_host_name` varchar(100) NOT NULL, - `e2e_vpn_key` varchar(30) NOT NULL, - `service_type` varchar(30) NOT NULL, - `connection_id` varchar(100) NOT NULL, - PRIMARY KEY (`vnf_host_name`,`e2e_vpn_key`,`service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE2CONNECTION_MAPPING ( + vnf_host_name varchar(100) NOT NULL, + e2e_vpn_key varchar(30) NOT NULL, + service_type varchar(30) NOT NULL, + connection_id varchar(100) NOT NULL, + PRIMARY KEY (vnf_host_name,e2e_vpn_key,service_type) +) ; -- --- Table structure for table `DEVICE2IPADDRESS_CONSUMPTION` +-- Table structure for table DEVICE2IPADDRESS_CONSUMPTION -- -CREATE TABLE `DEVICE2IPADDRESS_CONSUMPTION` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `device_id` varchar(100) NOT NULL, - `device_type` varchar(30) NOT NULL, - `ip_version` varchar(10) NOT NULL, - `consumption_key` varchar(100) NOT NULL, - `logical_interface_service_id` varchar(100) NOT NULL, - `address_type` varchar(30) NOT NULL, - `ip_consumed` varchar(50) NOT NULL, - `vnf_type` varchar(30) NOT NULL, - `secondary_key` varchar(100) DEFAULT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DEVICEIPADDRESS_CONSUMPTION` (`device_id`,`device_type`,`ip_version`) -) ENGINE=InnoDB AUTO_INCREMENT=1357 DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE2IPADDRESS_CONSUMPTION ( + serial_key int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + device_id varchar(100) NOT NULL, + device_type varchar(30) NOT NULL, + ip_version varchar(10) NOT NULL, + consumption_key varchar(100) NOT NULL, + logical_interface_service_id varchar(100) NOT NULL, + address_type varchar(30) NOT NULL, + ip_consumed varchar(50) NOT NULL, + vnf_type varchar(30) NOT NULL, + secondary_key varchar(100) DEFAULT NULL, + PRIMARY KEY (serial_key) +) ; -- --- Table structure for table `DEVICE2IPADDRESS_MAPPING` +-- Table structure for table DEVICE2IPADDRESS_MAPPING -- -CREATE TABLE `DEVICE2IPADDRESS_MAPPING` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `device_id` varchar(100) NOT NULL, - `device_type` varchar(30) NOT NULL, - `secondary_key` varchar(100) NOT NULL, - `secondary_key_type` varchar(30) NOT NULL, - `address` varchar(50) NOT NULL, - `address_type` varchar(30) NOT NULL, - `ip_version` varchar(10) NOT NULL, - `length` int(11) NOT NULL, - `status` varchar(30) NOT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DEVICE2IPADDRESS_MAPPING` (`device_id`,`device_type`,`secondary_key`,`secondary_key_type`,`address`,`address_type`) -) ENGINE=InnoDB AUTO_INCREMENT=4734 DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE2IPADDRESS_MAPPING ( + serial_key int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + device_id varchar(100) NOT NULL, + device_type varchar(30) NOT NULL, + secondary_key varchar(100) NOT NULL, + secondary_key_type varchar(30) NOT NULL, + address varchar(50) NOT NULL, + address_type varchar(30) NOT NULL, + ip_version varchar(10) NOT NULL, + length int NOT NULL, + status varchar(30) NOT NULL, + PRIMARY KEY (serial_key) +) ; -- --- Table structure for table `DEVICE_AUTHENTICATION` +-- Table structure for table DEVICE_AUTHENTICATION -- -CREATE TABLE `DEVICE_AUTHENTICATION` ( - `device_authentication_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `user_name` varchar(50) DEFAULT NULL, - `password` varchar(100) DEFAULT NULL, - `protocol` varchar(100) DEFAULT NULL, - `port_number` int(11) DEFAULT NULL, - PRIMARY KEY (`device_authentication_id`), - UNIQUE KEY `device_authentication_id` (`device_authentication_id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE_AUTHENTICATION ( + device_authentication_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vnf_type varchar(50) DEFAULT NULL, + user_name varchar(50) DEFAULT NULL, + password varchar(100) DEFAULT NULL, + protocol varchar(100) DEFAULT NULL, + port_number int DEFAULT NULL, + PRIMARY KEY (device_authentication_id) +) ; -- --- Table structure for table `DEVICE_INTERFACE_LOG` +-- Table structure for table DEVICE_INTERFACE_LOG -- -CREATE TABLE `DEVICE_INTERFACE_LOG` ( - `device_interface_log_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(50) DEFAULT NULL, - `request_id` varchar(50) DEFAULT NULL, - `creation_date` datetime NOT NULL, - `log` longtext, - PRIMARY KEY (`device_interface_log_id`), - UNIQUE KEY `device_interface_log_id` (`device_interface_log_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE_INTERFACE_LOG ( + device_interface_log_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_instance_id varchar(50) DEFAULT NULL, + request_id varchar(50) DEFAULT NULL, + creation_date timestamp NOT NULL, + log long varchar, + PRIMARY KEY (device_interface_log_id) +) ; -- --- Table structure for table `DEVICE_INTERFACE_PROTOCOL` +-- Table structure for table DEVICE_INTERFACE_PROTOCOL -- -CREATE TABLE `DEVICE_INTERFACE_PROTOCOL` ( - `device_interface_protocol_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `protocol` varchar(50) DEFAULT NULL, - `module` varchar(50) DEFAULT NULL, - `dg_rpc` varchar(50) DEFAULT NULL, - PRIMARY KEY (`device_interface_protocol_id`), - UNIQUE KEY `device_interface_protocol_id` (`device_interface_protocol_id`), - UNIQUE KEY `vnf_type` (`vnf_type`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +CREATE TABLE DEVICE_INTERFACE_PROTOCOL ( + device_interface_protocol_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vnf_type varchar(50) DEFAULT NULL, + protocol varchar(50) DEFAULT NULL, + module varchar(50) DEFAULT NULL, + dg_rpc varchar(50) DEFAULT NULL, + PRIMARY KEY (device_interface_protocol_id) +) ; -- --- Table structure for table `DOWNLOAD_CONFIG_TEMPLATE` +-- Table structure for table DOWNLOAD_CONFIG_TEMPLATE -- -CREATE TABLE `DOWNLOAD_CONFIG_TEMPLATE` ( - `download_config_template_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) NOT NULL, - `protocol` varchar(50) NOT NULL, - `template` longtext, - PRIMARY KEY (`download_config_template_id`), - UNIQUE KEY `download_config_template_id` (`download_config_template_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE DOWNLOAD_CONFIG_TEMPLATE ( + download_config_template_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vnf_type varchar(50) NOT NULL, + protocol varchar(50) NOT NULL, + template long varchar, + PRIMARY KEY (download_config_template_id) +) ; -- --- Table structure for table `DOWNLOAD_DG_REFERENCE` +-- Table structure for table DOWNLOAD_DG_REFERENCE -- -CREATE TABLE `DOWNLOAD_DG_REFERENCE` ( - `download_dg_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `protocol` varchar(50) NOT NULL, - `download_config_dg` varchar(50) NOT NULL, - PRIMARY KEY (`download_dg_reference_id`), - UNIQUE KEY `download_dg_reference_id` (`download_dg_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_CLIENT_KEY_INDEX` --- - -CREATE TABLE `EIPAM_CLIENT_KEY_INDEX` ( - `vnf_name_prefix` varchar(100) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnf_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE DOWNLOAD_DG_REFERENCE ( + download_dg_reference_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + protocol varchar(50) NOT NULL, + download_config_dg varchar(50) NOT NULL, + PRIMARY KEY (download_dg_reference_id) +) ; -- --- Table structure for table `EIPAM_IP_ASSIGNMENTS` +-- Table structure for table EIPAM_CLIENT_KEY_INDEX -- -CREATE TABLE `EIPAM_IP_ASSIGNMENTS` ( - `plan_name` varchar(40) NOT NULL, - `client_key` varchar(100) NOT NULL, - `service_type` varchar(40) NOT NULL, - `ip_address` varchar(40) DEFAULT NULL, - `prefix_length` int(2) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `service_instance_id` varchar(80) DEFAULT NULL, - `last_modified_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `prev_status` varchar(20) DEFAULT NULL, - `info` varchar(255) DEFAULT NULL, - PRIMARY KEY (`plan_name`,`client_key`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE EIPAM_CLIENT_KEY_INDEX ( + vnf_name_prefix varchar(100) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (vnf_name_prefix) +) ; -- --- Table structure for table `EIPAM_IP_POOLS` +-- Table structure for table EIPAM_IP_ASSIGNMENTS -- -CREATE TABLE `EIPAM_IP_POOLS` ( - `pool_id` int(11) NOT NULL AUTO_INCREMENT, - `key_name` varchar(50) NOT NULL, - `key_value` varchar(255) NOT NULL, - `level` int(2) NOT NULL, - `plan_name` varchar(50) NOT NULL, - `address_family` varchar(10) NOT NULL, - `parent_pool` varchar(255) NOT NULL, - `service_instance_id` varchar(255) DEFAULT NULL, - `network_id` varchar(255) DEFAULT NULL, - `created_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `delete_failure` varchar(20) DEFAULT NULL, - `delete_request_id` varchar(255) DEFAULT NULL, - PRIMARY KEY (`pool_id`) -) ENGINE=InnoDB AUTO_INCREMENT=339 DEFAULT CHARSET=latin1 COMMENT='This table will capture the pools being created by SDN-C in EIPAM_IP_POOLS. There is no data migration for existing vPE pool data.'; +CREATE TABLE EIPAM_IP_ASSIGNMENTS ( + plan_name varchar(40) NOT NULL, + client_key varchar(100) NOT NULL, + service_type varchar(40) NOT NULL, + ip_address varchar(40) DEFAULT NULL, + prefix_length int, + status varchar(255) DEFAULT NULL, + service_instance_id varchar(80) DEFAULT NULL, + last_modified_ts timestamp DEFAULT CURRENT_TIMESTAMP, + prev_status varchar(20) DEFAULT NULL, + info varchar(255) DEFAULT NULL, + PRIMARY KEY (plan_name,client_key) +) ; -- --- Table structure for table `EIPAM_IP_SUBNETS` --- - -CREATE TABLE `EIPAM_IP_SUBNETS` ( - `entity_id` int(6) NOT NULL, - `service_type` varchar(40) NOT NULL, - `plan_name` varchar(50) NOT NULL, - `address_family` varchar(10) NOT NULL, - `ip_address` varchar(40) NOT NULL, - `prefix_length` int(3) NOT NULL, - `status` varchar(20) NOT NULL, - `last_modified_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `network_id` varchar(255) DEFAULT NULL, - `pool_id` int(11) DEFAULT NULL, - `dealloc_failure` varchar(20) DEFAULT NULL, - `dealloc_request_id` varchar(255) DEFAULT NULL, - PRIMARY KEY (`entity_id`), - KEY `FK_EIPAM_IP_SUBNETS_EIPAM_IP_POOLS` (`pool_id`), - CONSTRAINT `EIPAM_IP_SUBNETS_ibfk_1` FOREIGN KEY (`pool_id`) REFERENCES `EIPAM_IP_POOLS` (`pool_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK_EIPAM_IP_SUBNETS_EIPAM_IP_POOLS` FOREIGN KEY (`pool_id`) REFERENCES `EIPAM_IP_POOLS` (`pool_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_IP_SUBNET_KEYS` --- - -CREATE TABLE `EIPAM_IP_SUBNET_KEYS` ( - `entity_id` int(6) NOT NULL, - `key_name` varchar(50) NOT NULL, - `key_value` varchar(255) NOT NULL, - `level` int(2) NOT NULL, - PRIMARY KEY (`entity_id`,`key_name`,`key_value`,`level`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_REQUEST_KEY` +-- Table structure for table EIPAM_IP_POOLS +-- + +CREATE TABLE EIPAM_IP_POOLS ( + pool_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + key_name varchar(50) NOT NULL, + key_value varchar(255) NOT NULL, + level int NOT NULL, + plan_name varchar(50) NOT NULL, + address_family varchar(10) NOT NULL, + parent_pool varchar(255) NOT NULL, + service_instance_id varchar(255) DEFAULT NULL, + network_id varchar(255) DEFAULT NULL, + created_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + delete_failure varchar(20) DEFAULT NULL, + delete_request_id varchar(255) DEFAULT NULL, + PRIMARY KEY (pool_id) +) ; + +-- +-- Table structure for table EIPAM_IP_SUBNETS +-- + +CREATE TABLE EIPAM_IP_SUBNETS ( + entity_id int NOT NULL, + service_type varchar(40) NOT NULL, + plan_name varchar(50) NOT NULL, + address_family varchar(10) NOT NULL, + ip_address varchar(40) NOT NULL, + prefix_length int NOT NULL, + status varchar(20) NOT NULL, + last_modified_ts timestamp DEFAULT CURRENT_TIMESTAMP, + network_id varchar(255) DEFAULT NULL, + pool_id int DEFAULT NULL, + dealloc_failure varchar(20) DEFAULT NULL, + dealloc_request_id varchar(255) DEFAULT NULL, + PRIMARY KEY (entity_id) +) ; + +-- +-- Table structure for table EIPAM_IP_SUBNET_KEYS +-- + +CREATE TABLE EIPAM_IP_SUBNET_KEYS ( + entity_id int NOT NULL, + key_name varchar(50) NOT NULL, + key_value varchar(255) NOT NULL, + level int NOT NULL, + PRIMARY KEY (entity_id,key_name,key_value,level) +) ; + +-- +-- Table structure for table EIPAM_REQUEST_KEY +-- + +CREATE TABLE EIPAM_REQUEST_KEY ( + key_name_1 varchar(50) NOT NULL, + address_family varchar(4) NOT NULL, + serial_key int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + plan_name varchar(50) NOT NULL, + request_length int NOT NULL, + pools_length int NOT NULL, + plan_length int NOT NULL, + key_name_0 varchar(50) NOT NULL, + key_name_type_0 varchar(255) NOT NULL, + key_name_type_1 varchar(255) NOT NULL, + prefix_length int NOT NULL, + group_flag char(1) NOT NULL, + address_type varchar(20) DEFAULT NULL, + PRIMARY KEY (key_name_1,address_family) +) ; + -- +-- Table structure for table EXTERNAL_DATA +-- + +CREATE TABLE EXTERNAL_DATA ( + external_data_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_id int DEFAULT NULL, + param_name varchar(30) NOT NULL, + param_value varchar(50) NOT NULL, + PRIMARY KEY (external_data_id) +) ; + +-- +-- Table structure for table FLOW_UPDATES +-- + +CREATE TABLE FLOW_UPDATES ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + status varchar(10) NOT NULL DEFAULT 'NEW' CONSTRAINT status_ck_3 CHECK(status IN ('NEW', 'COMPLETE', 'FAILED')), + create_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + last_processed_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + odl varchar(128) DEFAULT NULL, + address_family varchar(4) DEFAULT NULL CONSTRAINT fam_ck CHECK(address_family IN ('IPV4', 'IPV6')), + destination_prefix varchar(50) DEFAULT NULL, + communities varchar(6000) DEFAULT NULL, + route_key varchar(50) DEFAULT NULL, + PRIMARY KEY (seq) +) ; + +-- +-- Table structure for table GENERIC_L3_NETWORK +-- + +CREATE TABLE GENERIC_L3_NETWORK ( + network_id varchar(80) NOT NULL, + network_name varchar(80) DEFAULT NULL, + network_type varchar(80) DEFAULT NULL, + network_role varchar(80) DEFAULT NULL, + network_technology varchar(80) DEFAULT NULL, + neutron_network_id varchar(80) DEFAULT NULL, + is_bound_to_vpn smallint DEFAULT NULL, + orchestration_status varchar(20) DEFAULT NULL, + heat_stack_id varchar(80) DEFAULT NULL, + mso_catalog_key varchar(80) DEFAULT NULL, + service_id varchar(80) NOT NULL, + tenant_id varchar(80) NOT NULL, + physical_location_id varchar(20) DEFAULT NULL, + network_role_instance varchar(80) NOT NULL, + PRIMARY KEY (network_id) +) ; + +-- +-- Table structure for table GENERIC_L3_NETWORK_SUBNET +-- + +CREATE TABLE GENERIC_L3_NETWORK_SUBNET ( + network_id varchar(80) NOT NULL, + subnet_id varchar(80) NOT NULL, + neutron_subnet_id varchar(80) DEFAULT NULL, + gateway_address varchar(45) NOT NULL, + network_start_address varchar(45) NOT NULL, + cidr_mask varchar(20) NOT NULL, + ip_version char(1) NOT NULL, + orchestration_status varchar(64) NOT NULL, + dhcp_enabled smallint NOT NULL, + dhcp_start varchar(45) DEFAULT NULL, + dhcp_end varchar(45) DEFAULT NULL, + PRIMARY KEY (network_id,subnet_id) +) ; -CREATE TABLE `EIPAM_REQUEST_KEY` ( - `key_name_1` varchar(50) NOT NULL, - `address_family` varchar(4) NOT NULL, - `serial_key` int(2) NOT NULL AUTO_INCREMENT, - `plan_name` varchar(50) NOT NULL, - `request_length` int(2) NOT NULL, - `pools_length` int(2) NOT NULL, - `plan_length` int(2) NOT NULL, - `key_name_0` varchar(50) NOT NULL, - `key_name_type_0` varchar(255) NOT NULL, - `key_name_type_1` varchar(255) NOT NULL, - `prefix_length` int(2) NOT NULL, - `group_flag` char(1) NOT NULL, - `address_type` varchar(20) DEFAULT NULL, - PRIMARY KEY (`key_name_1`,`address_family`), - UNIQUE KEY `IX1_EIPAM_REQUEST_KEY` (`serial_key`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - --- --- Table structure for table `EXTERNAL_DATA` --- - -CREATE TABLE `EXTERNAL_DATA` ( - `external_data_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` int(11) DEFAULT NULL, - `param_name` varchar(30) NOT NULL, - `param_value` varchar(50) NOT NULL, - PRIMARY KEY (`external_data_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `FLOW_UPDATES` --- - -CREATE TABLE `FLOW_UPDATES` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `create_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `last_processed_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `odl` varchar(128) DEFAULT NULL, - `address_family` enum('IPV4','IPV6') DEFAULT NULL, - `destination_prefix` varchar(50) DEFAULT NULL, - `communities` varchar(6000) DEFAULT NULL, - `route_key` varchar(50) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK` --- - -CREATE TABLE `GENERIC_L3_NETWORK` ( - `network_id` varchar(80) NOT NULL, - `network_name` varchar(80) DEFAULT NULL, - `network_type` varchar(80) DEFAULT NULL, - `network_role` varchar(80) DEFAULT NULL, - `network_technology` varchar(80) DEFAULT NULL, - `neutron_network_id` varchar(80) DEFAULT NULL, - `is_bound_to_vpn` tinyint(1) DEFAULT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `service_id` varchar(80) NOT NULL, - `tenant_id` varchar(80) NOT NULL, - `physical_location_id` varchar(20) DEFAULT NULL, - `network_role_instance` varchar(80) NOT NULL, - PRIMARY KEY (`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK_SUBNET` --- - -CREATE TABLE `GENERIC_L3_NETWORK_SUBNET` ( - `network_id` varchar(80) NOT NULL, - `subnet_id` varchar(80) NOT NULL, - `neutron_subnet_id` varchar(80) DEFAULT NULL, - `gateway_address` varchar(45) NOT NULL, - `network_start_address` varchar(45) NOT NULL, - `cidr_mask` varchar(20) NOT NULL, - `ip_version` char(1) NOT NULL, - `orchestration_status` varchar(64) NOT NULL, - `dhcp_enabled` tinyint(1) NOT NULL, - `dhcp_start` varchar(45) DEFAULT NULL, - `dhcp_end` varchar(45) DEFAULT NULL, - PRIMARY KEY (`network_id`,`subnet_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK_VPN_BINDING` --- +-- +-- Table structure for table GENERIC_L3_NETWORK_VPN_BINDING +-- -CREATE TABLE `GENERIC_L3_NETWORK_VPN_BINDING` ( - `network_id` varchar(80) NOT NULL, - `vpn_id` varchar(80) NOT NULL, - PRIMARY KEY (`network_id`,`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_L3_NETWORK_VPN_BINDING ( + network_id varchar(80) NOT NULL, + vpn_id varchar(80) NOT NULL, + PRIMARY KEY (network_id,vpn_id) +) ; -- --- Table structure for table `GENERIC_RESOURCE_NAME` --- - -CREATE TABLE `GENERIC_RESOURCE_NAME` ( - `type` varchar(50) NOT NULL, - `name` varchar(255) NOT NULL, - `prefix` varchar(255) NULL, - `name_index` int(11) NULL, - `context_id` varchar(255) NULL, - PRIMARY KEY (`type`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- Table structure for table GENERIC_RESOURCE_NAME +-- + +CREATE TABLE GENERIC_RESOURCE_NAME ( + type varchar(50) NOT NULL, + name varchar(255) NOT NULL, + prefix varchar(255) , + name_index int , + context_id varchar(255) , + PRIMARY KEY (type,name) +) ; -- --- Table structure for table `GENERIC_VNF` +-- Table structure for table GENERIC_VNF -- -CREATE TABLE `GENERIC_VNF` ( - `vnf_id` varchar(80) NOT NULL, - `vnf_name` varchar(80) NOT NULL, - `vnf_type` varchar(200) NOT NULL, - `vnf_name2` varchar(80) DEFAULT NULL, - `service_id` varchar(80) NOT NULL, - `equipment_role` varchar(80) NOT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `prov_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `regional_resource_zone` varchar(80) DEFAULT NULL, - `operational_state` varchar(80) DEFAULT NULL, - `license_key` varchar(80) DEFAULT NULL, - `ipv4_oam_address` varchar(20) DEFAULT NULL, - `ipv4_loopback0_address` varchar(20) DEFAULT NULL, - `nm_lan_v6_address` varchar(40) DEFAULT NULL, - `management_v6_address` varchar(40) DEFAULT NULL, - `management_option` varchar(45) DEFAULT NULL, - `vcpu` varchar(45) DEFAULT NULL, - `vmemory` varchar(45) DEFAULT NULL, - `vdisk` varchar(45) DEFAULT NULL, - `vcpu_units` varchar(45) DEFAULT NULL, - `vmemory_units` varchar(45) DEFAULT NULL, - `vdisk_units` varchar(45) DEFAULT NULL, - PRIMARY KEY (`vnf_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF ( + vnf_id varchar(80) NOT NULL, + vnf_name varchar(80) NOT NULL, + vnf_type varchar(200) NOT NULL, + vnf_name2 varchar(80) DEFAULT NULL, + service_id varchar(80) NOT NULL, + equipment_role varchar(80) NOT NULL, + orchestration_status varchar(20) DEFAULT NULL, + prov_status varchar(20) DEFAULT NULL, + heat_stack_id varchar(80) DEFAULT NULL, + mso_catalog_key varchar(80) DEFAULT NULL, + regional_resource_zone varchar(80) DEFAULT NULL, + operational_state varchar(80) DEFAULT NULL, + license_key varchar(80) DEFAULT NULL, + ipv4_oam_address varchar(20) DEFAULT NULL, + ipv4_loopback0_address varchar(20) DEFAULT NULL, + nm_lan_v6_address varchar(40) DEFAULT NULL, + management_v6_address varchar(40) DEFAULT NULL, + management_option varchar(45) DEFAULT NULL, + vcpu varchar(45) DEFAULT NULL, + vmemory varchar(45) DEFAULT NULL, + vdisk varchar(45) DEFAULT NULL, + vcpu_units varchar(45) DEFAULT NULL, + vmemory_units varchar(45) DEFAULT NULL, + vdisk_units varchar(45) DEFAULT NULL, + PRIMARY KEY (vnf_id) +) ; -- --- Table structure for table `GENERIC_VNF_L3_NETWORK` +-- Table structure for table GENERIC_VNF_L3_NETWORK -- -CREATE TABLE `GENERIC_VNF_L3_NETWORK` ( - `vnf_id` varchar(80) NOT NULL, - `network_id` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_id`,`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_L3_NETWORK ( + vnf_id varchar(80) NOT NULL, + network_id varchar(80) NOT NULL, + PRIMARY KEY (vnf_id,network_id) +) ; -- --- Table structure for table `GENERIC_VNF_LICENSE_MANAGEMENT` +-- Table structure for table GENERIC_VNF_LICENSE_MANAGEMENT -- -CREATE TABLE `GENERIC_VNF_LICENSE_MANAGEMENT` ( - `vnf_id` varchar(80) NOT NULL, - `att_uuid` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_id`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_LICENSE_MANAGEMENT ( + vnf_id varchar(80) NOT NULL, + att_uuid varchar(80) NOT NULL, + PRIMARY KEY (vnf_id,att_uuid) +) ; -- --- Table structure for table `GENERIC_VNF_LINTERFACE` +-- Table structure for table GENERIC_VNF_LINTERFACE -- -CREATE TABLE `GENERIC_VNF_LINTERFACE` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `interface_role` varchar(45) DEFAULT NULL, - `v6_wan_link_ip` varchar(45) DEFAULT NULL, - `selflink` varchar(128) DEFAULT NULL, - `interface_id` varchar(45) DEFAULT NULL, - `macaddr` varchar(64) DEFAULT NULL, - `network_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`), - KEY `FK_GENERIC_VNF_LINTERFACE_GENERIC_VNF_IDX` (`vnf_id`), - CONSTRAINT `FK_GENERIC_VNF_LINTERFACE_GENERIC_VNF` FOREIGN KEY (`vnf_id`) REFERENCES `GENERIC_VNF` (`vnf_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_LINTERFACE ( + vnf_id varchar(80) NOT NULL, + interface_name varchar(255) NOT NULL, + interface_role varchar(45) DEFAULT NULL, + v6_wan_link_ip varchar(45) DEFAULT NULL, + selflink varchar(128) DEFAULT NULL, + interface_id varchar(45) DEFAULT NULL, + macaddr varchar(64) DEFAULT NULL, + network_name varchar(255) DEFAULT NULL, + PRIMARY KEY (vnf_id,interface_name) +) ; -- --- Table structure for table `GENERIC_VNF_PSERVER` +-- Table structure for table GENERIC_VNF_PSERVER -- -CREATE TABLE `GENERIC_VNF_PSERVER` ( - `vnf_id` varchar(64) NOT NULL, - `hostname` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_id`,`hostname`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_PSERVER ( + vnf_id varchar(64) NOT NULL, + hostname varchar(255) NOT NULL, + PRIMARY KEY (vnf_id,hostname) +) ; -- --- Table structure for table `GENERIC_VNF_SERVICE_INSTANCE` +-- Table structure for table GENERIC_VNF_SERVICE_INSTANCE -- -CREATE TABLE `GENERIC_VNF_SERVICE_INSTANCE` ( - `vnf_id` varchar(64) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - `relationship_key` varchar(64) NOT NULL, - `relationship_value` varchar(64) DEFAULT NULL, - `global_customer_id` varchar(255) DEFAULT NULL, - `service_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`service_instance_id`,`relationship_key`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_SERVICE_INSTANCE ( + vnf_id varchar(64) NOT NULL, + service_instance_id varchar(255) NOT NULL, + relationship_key varchar(64) NOT NULL, + relationship_value varchar(64) DEFAULT NULL, + global_customer_id varchar(255) DEFAULT NULL, + service_type varchar(255) DEFAULT NULL, + PRIMARY KEY (vnf_id,service_instance_id,relationship_key) +) ; -- --- Table structure for table `GENERIC_VNF_VNF_IMAGE` +-- Table structure for table GENERIC_VNF_VNF_IMAGE -- -CREATE TABLE `GENERIC_VNF_VNF_IMAGE` ( - `vnf_id` varchar(64) NOT NULL, - `att_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_id`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_VNF_IMAGE ( + vnf_id varchar(64) NOT NULL, + att_uuid varchar(255) NOT NULL, + PRIMARY KEY (vnf_id,att_uuid) +) ; -- --- Table structure for table `GENERIC_VNF_VSERVER` +-- Table structure for table GENERIC_VNF_VSERVER -- -CREATE TABLE `GENERIC_VNF_VSERVER` ( - `vnf_id` varchar(80) NOT NULL, - `vserver_id` varchar(128) NOT NULL, - `tenant_id` varchar(128) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VNF_VSERVER ( + vnf_id varchar(80) NOT NULL, + vserver_id varchar(128) NOT NULL, + tenant_id varchar(128) DEFAULT NULL, + PRIMARY KEY (vnf_id,vserver_id) +) ; -- --- Table structure for table `GENERIC_VPN_BINDING` +-- Table structure for table GENERIC_VPN_BINDING -- -CREATE TABLE `GENERIC_VPN_BINDING` ( - `vpn_id` varchar(80) NOT NULL, - `vpn_name` varchar(80) NOT NULL, - `global_route_target` varchar(80) NOT NULL, - PRIMARY KEY (`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GENERIC_VPN_BINDING ( + vpn_id varchar(80) NOT NULL, + vpn_name varchar(80) NOT NULL, + global_route_target varchar(80) NOT NULL, + PRIMARY KEY (vpn_id) +) ; -- --- Table structure for table `GET_CONFIG_TEMPLATE` +-- Table structure for table GET_CONFIG_TEMPLATE -- -CREATE TABLE `GET_CONFIG_TEMPLATE` ( - `get_config_template_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) NOT NULL, - `device_interface_protocol_id` int(11) NOT NULL, - `xml_processing` varchar(1) DEFAULT NULL, - `xml_protocol` varchar(30) DEFAULT NULL, - `template` longtext, - PRIMARY KEY (`get_config_template_id`), - UNIQUE KEY `get_config_template_id` (`get_config_template_id`), - KEY `get_config_template_ibfk_1` (`device_interface_protocol_id`), - CONSTRAINT `get_config_template_ibfk_1` FOREIGN KEY (`device_interface_protocol_id`) REFERENCES `DEVICE_INTERFACE_PROTOCOL` (`device_interface_protocol_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE GET_CONFIG_TEMPLATE ( + get_config_template_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vnf_type varchar(50) NOT NULL, + device_interface_protocol_id int NOT NULL, + xml_processing varchar(1) DEFAULT NULL, + xml_protocol varchar(30) DEFAULT NULL, + template long varchar, + PRIMARY KEY (get_config_template_id) +) ; -- --- Table structure for table `LOCATION` +-- Table structure for table LOCATION -- -CREATE TABLE `LOCATION` ( - `loc_id` int(11) NOT NULL AUTO_INCREMENT, - `address` varchar(150) NOT NULL, - `city_code_id` int(11) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`loc_id`), - KEY `IN1_LOCATION_IDX` (`city_code_id`), - CONSTRAINT `FK1_LOCATION` FOREIGN KEY (`city_code_id`) REFERENCES `CITY_CODE` (`city_code_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=327 DEFAULT CHARSET=latin1; +CREATE TABLE LOCATION ( + loc_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + address varchar(150) NOT NULL, + city_code_id int NOT NULL, + create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (loc_id) +) ; -- --- Table structure for table `HOSTNAME` +-- Table structure for table HOSTNAME -- -CREATE TABLE `HOSTNAME` ( - `hostname` varchar(21) NOT NULL, - `parent_hostname` varchar(21) DEFAULT NULL, - `cust_id` int(11) NOT NULL, - `loc_id` int(11) NOT NULL, - `site_sequence` varchar(2) NOT NULL, - `server_sequence` varchar(2) NOT NULL, - `activation_code` varchar(11) DEFAULT NULL, - `vnf_sequence` varchar(2) DEFAULT NULL, - `vendor_code` varchar(1) NOT NULL, - `virtual_device_type` varchar(2) DEFAULT NULL, - `device_sequence` varchar(3) DEFAULT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`hostname`), - KEY `IN1_HOSTNAME` (`cust_id`), - KEY `IN2_HOSTNAME` (`loc_id`), - KEY `IN3_HOSTNAME` (`vendor_code`), - KEY `IN4_HOSTNAME` (`parent_hostname`), - CONSTRAINT `FK1_HOSTNAME` FOREIGN KEY (`cust_id`) REFERENCES `CUSTOMER` (`cust_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK2_HOSTNAME` FOREIGN KEY (`loc_id`) REFERENCES `LOCATION` (`loc_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK4_HOSTNAME` FOREIGN KEY (`parent_hostname`) REFERENCES `HOSTNAME` (`hostname`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE HOSTNAME ( + hostname varchar(21) NOT NULL, + parent_hostname varchar(21) DEFAULT NULL, + cust_id int NOT NULL, + loc_id int NOT NULL, + site_sequence varchar(2) NOT NULL, + server_sequence varchar(2) NOT NULL, + activation_code varchar(11) DEFAULT NULL, + vnf_sequence varchar(2) DEFAULT NULL, + vendor_code varchar(1) NOT NULL, + virtual_device_type varchar(2) DEFAULT NULL, + device_sequence varchar(3) DEFAULT NULL, + create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (hostname) +) ; -- --- Table structure for table `IPV4_ADDRESS_POOL` +-- Table structure for table IPV4_ADDRESS_POOL -- -CREATE TABLE `IPV4_ADDRESS_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `universe` varchar(40) NOT NULL, - `status` varchar(40) NOT NULL, - `ipv4_addr` varchar(20) NOT NULL, - PRIMARY KEY (`ipv4_addr`,`universe`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE IPV4_ADDRESS_POOL ( + aic_site_id varchar(100) NOT NULL, + universe varchar(40) NOT NULL, + status varchar(40) NOT NULL, + ipv4_addr varchar(20) NOT NULL, + PRIMARY KEY (ipv4_addr,universe) +) ; -- --- Table structure for table `LINK_MASTER` +-- Table structure for table LINK_MASTER -- -CREATE TABLE `LINK_MASTER` ( - `link_interface_ip` varchar(20) NOT NULL, - `source_crs_name` varchar(20) NOT NULL, - `destination_crs_name` varchar(20) NOT NULL, - `max_reserved_bw` int(11) DEFAULT NULL, - `default_cost` int(11) DEFAULT NULL, - `bundle_name` varchar(20) DEFAULT NULL, - PRIMARY KEY (`link_interface_ip`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE LINK_MASTER ( + link_interface_ip varchar(20) NOT NULL, + source_crs_name varchar(20) NOT NULL, + destination_crs_name varchar(20) NOT NULL, + max_reserved_bw int DEFAULT NULL, + default_cost int DEFAULT NULL, + bundle_name varchar(20) DEFAULT NULL, + PRIMARY KEY (link_interface_ip) +) ; -- --- Table structure for table `LINTERFACE_VLAN` +-- Table structure for table LINTERFACE_VLAN -- -CREATE TABLE `LINTERFACE_VLAN` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `vlan_id_inner` varchar(64) DEFAULT NULL, - `vlan_id_outer` varchar(64) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`), - KEY `FK_LINTERFACE_VLAN_GENERIC_VNF_LINTERFACE_IDX` (`vnf_id`,`interface_name`), - CONSTRAINT `FK_LINTERFACE_VLAN_GENERIC_VNF_LINTERFACE` FOREIGN KEY (`vnf_id`, `interface_name`) REFERENCES `GENERIC_VNF_LINTERFACE` (`vnf_id`, `interface_name`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE LINTERFACE_VLAN ( + vnf_id varchar(80) NOT NULL, + interface_name varchar(255) NOT NULL, + vlan_interface varchar(255) NOT NULL, + vlan_id_inner varchar(64) DEFAULT NULL, + vlan_id_outer varchar(64) DEFAULT NULL, + PRIMARY KEY (vnf_id,interface_name,vlan_interface) +) ; + + +-- +-- Table structure for table MAX_PORT_SPEED +-- +CREATE TABLE MAX_PORT_SPEED ( + max_port_speed_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + image_file_name varchar(50) NOT NULL, + end_point_position varchar(50) NOT NULL, + interface_name varchar(100) NOT NULL, + max_speed bigint NOT NULL, + unit varchar(10) NOT NULL, + PRIMARY KEY (max_port_speed_id) +) ; -- --- Table structure for table `MAX_PORT_SPEED` +-- Table structure for table MAX_SERVER_SPEED -- -CREATE TABLE `MAX_PORT_SPEED` ( - `max_port_speed_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `image_file_name` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `interface_name` varchar(100) NOT NULL, - `max_speed` bigint(20) NOT NULL, - `unit` varchar(10) NOT NULL, - PRIMARY KEY (`max_port_speed_id`), - UNIQUE KEY `max_port_speed_id` (`max_port_speed_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE MAX_SERVER_SPEED ( + max_server_speed_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + server_model varchar(50) NOT NULL, + evc_count smallint NOT NULL, + max_speed bigint NOT NULL, + unit varchar(10) NOT NULL, + description varchar(500) DEFAULT NULL, + PRIMARY KEY (max_server_speed_id) +) ; -- --- Table structure for table `MAX_SERVER_SPEED` +-- Table structure for table NAMING_POLICY_VM_NAME_INDEX -- -CREATE TABLE `MAX_SERVER_SPEED` ( - `max_server_speed_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `server_model` varchar(50) NOT NULL, - `evc_count` smallint(6) NOT NULL, - `max_speed` bigint(20) NOT NULL, - `unit` varchar(10) NOT NULL, - `description` varchar(500) DEFAULT NULL, - PRIMARY KEY (`max_server_speed_id`), - UNIQUE KEY `max_server_speed_id` (`max_server_speed_id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; +CREATE TABLE NAMING_POLICY_VM_NAME_INDEX ( + vm_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (vm_name_prefix) +) ; -- --- Table structure for table `NAMING_POLICY_VM_NAME_INDEX` +-- Table structure for table NAMING_POLICY_VNFC_NAME_INDEX -- -CREATE TABLE `NAMING_POLICY_VM_NAME_INDEX` ( - `vm_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vm_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NAMING_POLICY_VNFC_NAME_INDEX ( + vnfc_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (vnfc_name_prefix) +) ; -- --- Table structure for table `NAMING_POLICY_VNFC_NAME_INDEX` +-- Table structure for table NBNC_ASSIGN_VPN_OVERRIDE -- -CREATE TABLE `NAMING_POLICY_VNFC_NAME_INDEX` ( - `vnfc_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnfc_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NBNC_ASSIGN_VPN_OVERRIDE ( + vpn_id varchar(12) NOT NULL DEFAULT '', + vpn_rt varchar(16) NOT NULL DEFAULT '', + service_type varchar(16) NOT NULL DEFAULT '', + be_location varchar(16) NOT NULL DEFAULT '', + be_type varchar(32) NOT NULL DEFAULT '', + be_id varchar(32) DEFAULT NULL, + description varchar(128) DEFAULT NULL, + PRIMARY KEY (vpn_id,vpn_rt,service_type,be_location,be_type) +) ; -- --- Table structure for table `NBNC_ASSIGN_VPN_OVERRIDE` +-- Table structure for table NBNC_BORDER_ELEMENT -- -CREATE TABLE `NBNC_ASSIGN_VPN_OVERRIDE` ( - `vpn_id` varchar(12) NOT NULL DEFAULT '', - `vpn_rt` varchar(16) NOT NULL DEFAULT '', - `service_type` varchar(16) NOT NULL DEFAULT '', - `be_location` varchar(16) NOT NULL DEFAULT '', - `be_type` varchar(32) NOT NULL DEFAULT '', - `be_id` varchar(32) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - PRIMARY KEY (`vpn_id`,`vpn_rt`,`service_type`,`be_location`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NBNC_BORDER_ELEMENT ( + be_id varchar(32) NOT NULL, + be_type varchar(16) NOT NULL, + be_name varchar(32) DEFAULT NULL, + be_host_vnf_id varchar(32) DEFAULT NULL, + service_type varchar(16) DEFAULT NULL, + tangibility varchar(16) DEFAULT NULL, + usage_order smallint DEFAULT NULL, + vlan_start smallint DEFAULT NULL, + vlan_end smallint DEFAULT NULL, + ipv4_subnet varchar(18) DEFAULT NULL, + ipv6_subnet varchar(68) DEFAULT NULL, + network_ip varchar(48) DEFAULT NULL, + be_location varchar(16) DEFAULT NULL, + description varchar(128) DEFAULT NULL, + updated_timestamp timestamp DEFAULT NULL, + log_link_model_uuid varchar(64) DEFAULT NULL, + PRIMARY KEY (be_id,be_type) +) ; -- --- Table structure for table `NBNC_BORDER_ELEMENT` +-- Table structure for table NBNC_IPE -- -CREATE TABLE `NBNC_BORDER_ELEMENT` ( - `be_id` varchar(32) NOT NULL, - `be_type` varchar(16) NOT NULL, - `be_name` varchar(32) DEFAULT NULL, - `be_host_vnf_id` varchar(32) DEFAULT NULL, - `service_type` varchar(16) DEFAULT NULL, - `tangibility` varchar(16) DEFAULT NULL, - `usage_order` smallint(6) DEFAULT NULL, - `vlan_start` smallint(6) DEFAULT NULL, - `vlan_end` smallint(6) DEFAULT NULL, - `ipv4_subnet` varchar(18) DEFAULT NULL, - `ipv6_subnet` varchar(68) DEFAULT NULL, - `network_ip` varchar(48) DEFAULT NULL, - `be_location` varchar(16) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - `log_link_model_uuid` varchar(64) DEFAULT NULL, - PRIMARY KEY (`be_id`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_IPE` --- - -CREATE TABLE `NBNC_IPE` ( - `ipe_name` varchar(32) NOT NULL, - `ipe_location` varchar(16) DEFAULT NULL, - `ipe_ip_address` varchar(16) DEFAULT NULL, - `ipe_id` varchar(8) DEFAULT NULL, - `service_type_array` varchar(512) DEFAULT NULL, - `ipe_status` varchar(32) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`ipe_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_IPE_PORT` +CREATE TABLE NBNC_IPE ( + ipe_name varchar(32) NOT NULL, + ipe_location varchar(16) DEFAULT NULL, + ipe_ip_address varchar(16) DEFAULT NULL, + ipe_id varchar(8) DEFAULT NULL, + service_type_array varchar(512) DEFAULT NULL, + ipe_status varchar(32) DEFAULT NULL, + updated_timestamp timestamp DEFAULT NULL, + PRIMARY KEY (ipe_name) +) ; + +-- +-- Table structure for table NBNC_IPE_PORT -- -CREATE TABLE `NBNC_IPE_PORT` ( - `port_id` varchar(16) NOT NULL, - `ipe_name` varchar(32) NOT NULL, - `be_id` varchar(32) NOT NULL, - `be_type` varchar(16) NOT NULL, - `port_type` varchar(16) DEFAULT NULL, - `ae_name` varchar(16) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`port_id`,`ipe_name`,`be_id`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_MAPPING_SBG_BGF` --- - -CREATE TABLE `NBNC_MAPPING_SBG_BGF` ( - `asbg_vlan` smallint(6) NOT NULL, - `bgf_vlan` smallint(6) NOT NULL, - PRIMARY KEY (`asbg_vlan`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NBNC_IPE_PORT ( + port_id varchar(16) NOT NULL, + ipe_name varchar(32) NOT NULL, + be_id varchar(32) NOT NULL, + be_type varchar(16) NOT NULL, + port_type varchar(16) DEFAULT NULL, + ae_name varchar(16) DEFAULT NULL, + description varchar(128) DEFAULT NULL, + updated_timestamp timestamp DEFAULT NULL, + PRIMARY KEY (port_id,ipe_name,be_id,be_type) +) ; + +-- +-- Table structure for table NBNC_MAPPING_SBG_BGF +-- + +CREATE TABLE NBNC_MAPPING_SBG_BGF ( + asbg_vlan smallint NOT NULL, + bgf_vlan smallint NOT NULL, + PRIMARY KEY (asbg_vlan) +) ; -- --- Table structure for table `NBNC_SERVICE` +-- Table structure for table NBNC_SERVICE -- -CREATE TABLE `NBNC_SERVICE` ( - `service_type` varchar(16) NOT NULL, - `service_model_uuid` varchar(64) NOT NULL, - `description` varchar(128) DEFAULT NULL, - `created_timestamp` timestamp NULL DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_SERVICE_VLAN` --- - -CREATE TABLE `NBNC_SERVICE_VLAN` ( - `be_id` varchar(32) NOT NULL, - `vlan` smallint(6) NOT NULL, - `service_type` varchar(16) DEFAULT NULL, - `be_type` varchar(16) DEFAULT NULL, - `be_name` varchar(32) DEFAULT NULL, - `be_host_vnf_id` varchar(32) DEFAULT NULL, - `be_location` varchar(16) DEFAULT NULL, - `be_usage_order` smallint(6) DEFAULT NULL, - `vlan_usage_order` smallint(6) DEFAULT NULL, - `status` varchar(16) DEFAULT 'AVAILABLE', - `request_id` varchar(64) DEFAULT NULL, - `service_instance_id` varchar(64) DEFAULT NULL, - `vni_id` varchar(16) DEFAULT NULL, - `customer_id` varchar(16) DEFAULT NULL, - `ipe1_router_name` varchar(32) DEFAULT NULL, - `ipe1_port_id` varchar(16) DEFAULT NULL, - `ipe1_ae_name` varchar(16) DEFAULT NULL, - `ipe2_router_name` varchar(32) DEFAULT NULL, - `ipe2_port_id` varchar(16) DEFAULT NULL, - `ipe2_ae_name` varchar(16) DEFAULT NULL, - `available_timestamp` timestamp NULL DEFAULT NULL, - `allocated_timestamp` timestamp NULL DEFAULT NULL, - `disabled_timestamp` timestamp NULL DEFAULT NULL, - `enabled_timestamp` timestamp NULL DEFAULT NULL, - `vpn_id` varchar(12) DEFAULT NULL, - `vpn_rt` varchar(16) DEFAULT NULL, - PRIMARY KEY (`be_id`,`vlan`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NCS_EXPECTED_ASYNC_REQUESTS` --- - -CREATE TABLE `NCS_EXPECTED_ASYNC_REQUESTS` ( - `ncs_request_id` varchar(255) NOT NULL, - `mso_gp_request_id` varchar(255) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - `sdn_module_name` varchar(255) NOT NULL, - `sdn_rpc_name` varchar(255) NOT NULL, - `sdn_service_action` varchar(255) DEFAULT NULL, - `ncs_rpc` varchar(255) NOT NULL, - `ncs_sub_action` varchar(255) DEFAULT NULL, - `status` varchar(255) NOT NULL DEFAULT 'inProgress', - `creation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`ncs_request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NETWORK_INSTANCE_NAME_INDEX` --- +CREATE TABLE NBNC_SERVICE ( + service_type varchar(16) NOT NULL, + service_model_uuid varchar(64) NOT NULL, + description varchar(128) DEFAULT NULL, + created_timestamp timestamp DEFAULT NULL, + updated_timestamp timestamp DEFAULT NULL, + PRIMARY KEY (service_type) +) ; + +-- +-- Table structure for table NBNC_SERVICE_VLAN +-- + +CREATE TABLE NBNC_SERVICE_VLAN ( + be_id varchar(32) NOT NULL, + vlan smallint NOT NULL, + service_type varchar(16) DEFAULT NULL, + be_type varchar(16) DEFAULT NULL, + be_name varchar(32) DEFAULT NULL, + be_host_vnf_id varchar(32) DEFAULT NULL, + be_location varchar(16) DEFAULT NULL, + be_usage_order smallint DEFAULT NULL, + vlan_usage_order smallint DEFAULT NULL, + status varchar(16) DEFAULT 'AVAILABLE', + request_id varchar(64) DEFAULT NULL, + service_instance_id varchar(64) DEFAULT NULL, + vni_id varchar(16) DEFAULT NULL, + customer_id varchar(16) DEFAULT NULL, + ipe1_router_name varchar(32) DEFAULT NULL, + ipe1_port_id varchar(16) DEFAULT NULL, + ipe1_ae_name varchar(16) DEFAULT NULL, + ipe2_router_name varchar(32) DEFAULT NULL, + ipe2_port_id varchar(16) DEFAULT NULL, + ipe2_ae_name varchar(16) DEFAULT NULL, + available_timestamp timestamp DEFAULT NULL, + allocated_timestamp timestamp DEFAULT NULL, + disabled_timestamp timestamp DEFAULT NULL, + enabled_timestamp timestamp DEFAULT NULL, + vpn_id varchar(12) DEFAULT NULL, + vpn_rt varchar(16) DEFAULT NULL, + PRIMARY KEY (be_id,vlan) +) ; + +-- +-- Table structure for table NCS_EXPECTED_ASYNC_REQUESTS +-- + +CREATE TABLE NCS_EXPECTED_ASYNC_REQUESTS ( + ncs_request_id varchar(255) NOT NULL, + mso_gp_request_id varchar(255) NOT NULL, + service_instance_id varchar(255) NOT NULL, + sdn_module_name varchar(255) NOT NULL, + sdn_rpc_name varchar(255) NOT NULL, + sdn_service_action varchar(255) DEFAULT NULL, + ncs_rpc varchar(255) NOT NULL, + ncs_sub_action varchar(255) DEFAULT NULL, + status varchar(255) NOT NULL DEFAULT 'inProgress', + creation_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (ncs_request_id) +) ; + +-- +-- Table structure for table NETWORK_INSTANCE_NAME_INDEX +-- -CREATE TABLE `NETWORK_INSTANCE_NAME_INDEX` ( - `network_instance_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`network_instance_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NETWORK_INSTANCE_NAME_INDEX ( + network_instance_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (network_instance_name_prefix) +) ; -- --- Table structure for table `SERVICE_MODEL` +-- Table structure for table SERVICE_MODEL -- -CREATE TABLE `SERVICE_MODEL` ( - `service_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `description` varchar(1024) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `category` varchar(255) DEFAULT NULL, - `ecomp_naming` char(1) DEFAULT NULL, - `service_instance_name_prefix` varchar(255) DEFAULT NULL, - `filename` varchar(100) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - PRIMARY KEY (`service_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_MODEL ( + service_uuid varchar(255) NOT NULL, + model_yaml blob, + invariant_uuid varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + name varchar(255) DEFAULT NULL, + description varchar(1024) DEFAULT NULL, + type varchar(255) DEFAULT NULL, + category varchar(255) DEFAULT NULL, + ecomp_naming char(1) DEFAULT NULL, + service_instance_name_prefix varchar(255) DEFAULT NULL, + filename varchar(100) DEFAULT NULL, + naming_policy varchar(255) DEFAULT NULL, + PRIMARY KEY (service_uuid) +) ; -- --- Table structure for table `NETWORK_MODEL` +-- Table structure for table NETWORK_MODEL -- -CREATE TABLE `NETWORK_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `service_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `network_type` varchar(255) DEFAULT NULL, - `network_role` varchar(255) DEFAULT NULL, - `network_technology` varchar(255) DEFAULT NULL, - `trunk_network_indicator` char(1) DEFAULT NULL, - `network_scope` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `is_shared_network` char(1) DEFAULT NULL, - `is_external_network` char(1) DEFAULT NULL, - `is_provider_network` char(1) DEFAULT NULL, - `physical_network_name` varchar(255) DEFAULT NULL, - `is_bound_to_vpn` char(1) DEFAULT NULL, - `vpn_binding` varchar(255) DEFAULT NULL, - `use_ipv4` char(1) DEFAULT NULL, - `ipv4_dhcp_enabled` char(1) DEFAULT NULL, - `ipv4_ip_version` char(1) DEFAULT NULL, - `ipv4_cidr_mask` varchar(255) DEFAULT NULL, - `eipam_v4_address_plan` varchar(255) DEFAULT NULL, - `use_ipv6` char(1) DEFAULT NULL, - `ipv6_dhcp_enabled` char(1) DEFAULT NULL, - `ipv6_ip_version` char(1) DEFAULT NULL, - `ipv6_cidr_mask` varchar(255) DEFAULT NULL, - `eipam_v6_address_plan` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`), - KEY `FK_NETWORK_MODEL` (`service_uuid`), - CONSTRAINT `FK_NETWORK_MODEL` FOREIGN KEY (`service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NETWORK_MODEL ( + customization_uuid varchar(255) NOT NULL, + service_uuid varchar(255) NOT NULL, + model_yaml clob, + invariant_uuid varchar(255) DEFAULT NULL, + uuid varchar(255) DEFAULT NULL, + network_type varchar(255) DEFAULT NULL, + network_role varchar(255) DEFAULT NULL, + network_technology varchar(255) DEFAULT NULL, + trunk_network_indicator char(1) DEFAULT NULL, + network_scope varchar(255) DEFAULT NULL, + naming_policy varchar(255) DEFAULT NULL, + ecomp_generated_naming char(1) DEFAULT NULL, + is_shared_network char(1) DEFAULT NULL, + is_external_network char(1) DEFAULT NULL, + is_provider_network char(1) DEFAULT NULL, + physical_network_name varchar(255) DEFAULT NULL, + is_bound_to_vpn char(1) DEFAULT NULL, + vpn_binding varchar(255) DEFAULT NULL, + use_ipv4 char(1) DEFAULT NULL, + ipv4_dhcp_enabled char(1) DEFAULT NULL, + ipv4_ip_version char(1) DEFAULT NULL, + ipv4_cidr_mask varchar(255) DEFAULT NULL, + eipam_v4_address_plan varchar(255) DEFAULT NULL, + use_ipv6 char(1) DEFAULT NULL, + ipv6_dhcp_enabled char(1) DEFAULT NULL, + ipv6_ip_version char(1) DEFAULT NULL, + ipv6_cidr_mask varchar(255) DEFAULT NULL, + eipam_v6_address_plan varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + PRIMARY KEY (customization_uuid) +) ; -- --- Table structure for table `NETWORK_PROFILE` +-- Table structure for table NETWORK_PROFILE -- -CREATE TABLE `NETWORK_PROFILE` ( - `network_type` varchar(100) NOT NULL, - `technology` varchar(100) NOT NULL, - PRIMARY KEY (`network_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NETWORK_PROFILE ( + network_type varchar(100) NOT NULL, + technology varchar(100) NOT NULL, + PRIMARY KEY (network_type) +) ; -- --- Table structure for table `NETWORK_ROLE_VPN_BINDING` +-- Table structure for table NETWORK_ROLE_VPN_BINDING -- -CREATE TABLE `NETWORK_ROLE_VPN_BINDING` ( - `network_role` varchar(80) NOT NULL, - `vpn_id` varchar(80) NOT NULL, - PRIMARY KEY (`network_role`,`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NETWORK_ROLE_VPN_BINDING ( + network_role varchar(80) NOT NULL, + vpn_id varchar(80) NOT NULL, + PRIMARY KEY (network_role,vpn_id) +) ; -- --- Table structure for table `NODE_TYPES` +-- Table structure for table NODE_TYPES -- -CREATE TABLE `NODE_TYPES` ( - `nodetype` varchar(80) NOT NULL, - PRIMARY KEY (`nodetype`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE NODE_TYPES ( + nodetype varchar(80) NOT NULL, + PRIMARY KEY (nodetype) +) ; -- --- Table structure for table `OBJECT_GROUPING` +-- Table structure for table OBJECT_GROUPING -- -CREATE TABLE `OBJECT_GROUPING` ( - `group_id` varchar(128) NOT NULL, - `group_type` varchar(128) NOT NULL, - PRIMARY KEY (`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE OBJECT_GROUPING ( + group_id varchar(128) NOT NULL, + group_type varchar(128) NOT NULL, + PRIMARY KEY (group_id) +) ; -- --- Table structure for table `OBJECT_GROUP_MEMBER_TRACKING` +-- Table structure for table OBJECT_GROUP_MEMBER_TRACKING -- -CREATE TABLE `OBJECT_GROUP_MEMBER_TRACKING` ( - `group_id` varchar(128) NOT NULL, - `key_id` varchar(128) NOT NULL, - `key_type` varchar(128) NOT NULL, - PRIMARY KEY (`group_id`,`key_id`,`key_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE OBJECT_GROUP_MEMBER_TRACKING ( + group_id varchar(128) NOT NULL, + key_id varchar(128) NOT NULL, + key_type varchar(128) NOT NULL, + PRIMARY KEY (group_id,key_id,key_type) +) ; -- --- Table structure for table `PARAMETERS` +-- Table structure for table PARAMETERS -- -CREATE TABLE `PARAMETERS` ( - `name` varchar(100) NOT NULL, - `value` varchar(128) NOT NULL, - `category` varchar(24) DEFAULT NULL, - `memo` varchar(128) DEFAULT NULL, - PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PARAMETERS ( + name varchar(100) NOT NULL, + value varchar(128) NOT NULL, + category varchar(24) DEFAULT NULL, + memo varchar(128) DEFAULT NULL, + PRIMARY KEY (name) +) ; -- --- Table structure for table `PE_INV` +-- Table structure for table PE_INV -- -CREATE TABLE `PE_INV` ( - `EQUIP_ID` int(11) DEFAULT NULL, - `EQUIP_TYPE` varchar(20) DEFAULT NULL, - `PTNII_EQUIP_NAME` varchar(20) DEFAULT NULL, - `IP_ADDR` varchar(15) DEFAULT NULL, - `ROUTER_PROV_STATUS` varchar(50) DEFAULT NULL, - `REGION` varchar(16) DEFAULT NULL, - `COUNTRY_ABBR` varchar(50) DEFAULT NULL, - `EQUIP_NAME_CODE` varchar(50) DEFAULT NULL, - `AS_NUMBER` varchar(5) DEFAULT NULL, - `LOOPBACK1` varchar(15) DEFAULT NULL, - `LOOPBACK2` varchar(15) DEFAULT NULL, - `LOOPBACK3` varchar(15) DEFAULT NULL, - `LOOPBACK40` varchar(15) DEFAULT NULL, - `LOOPBACK65535` varchar(15) DEFAULT NULL, - `INMS_LIST` varchar(20) DEFAULT NULL, - `ENCRYPTED_ACCESS_FLAG` varchar(50) DEFAULT NULL, - `SW_NAME` varchar(100) DEFAULT NULL, - `NMIPADDR` varchar(15) DEFAULT NULL, - `CREATE_DATE` datetime DEFAULT NULL, - `MOD_DATE` datetime DEFAULT NULL, - `FCN_CODE` varchar(50) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PE_INV ( + EQUIP_ID int DEFAULT NULL, + EQUIP_TYPE varchar(20) DEFAULT NULL, + PTNII_EQUIP_NAME varchar(20) DEFAULT NULL, + IP_ADDR varchar(15) DEFAULT NULL, + ROUTER_PROV_STATUS varchar(50) DEFAULT NULL, + REGION varchar(16) DEFAULT NULL, + COUNTRY_ABBR varchar(50) DEFAULT NULL, + EQUIP_NAME_CODE varchar(50) DEFAULT NULL, + AS_NUMBER varchar(5) DEFAULT NULL, + LOOPBACK1 varchar(15) DEFAULT NULL, + LOOPBACK2 varchar(15) DEFAULT NULL, + LOOPBACK3 varchar(15) DEFAULT NULL, + LOOPBACK40 varchar(15) DEFAULT NULL, + LOOPBACK65535 varchar(15) DEFAULT NULL, + INMS_LIST varchar(20) DEFAULT NULL, + ENCRYPTED_ACCESS_FLAG varchar(50) DEFAULT NULL, + SW_NAME varchar(100) DEFAULT NULL, + NMIPADDR varchar(15) DEFAULT NULL, + CREATE_DATE timestamp DEFAULT NULL, + MOD_DATE timestamp DEFAULT NULL, + FCN_CODE varchar(50) DEFAULT NULL +) ; -- --- Table structure for table `PHYSICAL_LINK` +-- Table structure for table PHYSICAL_LINK -- -CREATE TABLE `PHYSICAL_LINK` ( - `link_name` varchar(255) NOT NULL, - `speed_value` varchar(64) DEFAULT NULL, - `speed_units` varchar(64) DEFAULT NULL, - `circuit_id` varchar(255) NOT NULL, - `dual_mode` varchar(64) NOT NULL, - PRIMARY KEY (`link_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PHYSICAL_LINK ( + link_name varchar(255) NOT NULL, + speed_value varchar(64) DEFAULT NULL, + speed_units varchar(64) DEFAULT NULL, + circuit_id varchar(255) NOT NULL, + dual_mode varchar(64) NOT NULL, + PRIMARY KEY (link_name) +) ; -- --- Table structure for table `PHYSICAL_LINK_PINTERFACE` +-- Table structure for table PHYSICAL_LINK_PINTERFACE -- -CREATE TABLE `PHYSICAL_LINK_PINTERFACE` ( - `link_name` varchar(255) NOT NULL, - `hostname` varchar(255) NOT NULL, - `port_name_ft` varchar(255) NOT NULL, - PRIMARY KEY (`link_name`,`hostname`,`port_name_ft`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PHYSICAL_LINK_PINTERFACE ( + link_name varchar(255) NOT NULL, + hostname varchar(255) NOT NULL, + port_name_ft varchar(255) NOT NULL, + PRIMARY KEY (link_name,hostname,port_name_ft) +) ; -- --- Table structure for table `PINTERFACE` +-- Table structure for table PINTERFACE -- -CREATE TABLE `PINTERFACE` ( - `hostname` varchar(255) NOT NULL, - `port_name_ft` varchar(255) NOT NULL, - `interface_name` varchar(255) DEFAULT '', - `physical_speed` varchar(255) DEFAULT '', - `physical_units` varchar(255) DEFAULT '', - `port_description` varchar(255) DEFAULT '', - PRIMARY KEY (`hostname`,`port_name_ft`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PINTERFACE ( + hostname varchar(255) NOT NULL, + port_name_ft varchar(255) NOT NULL, + interface_name varchar(255) DEFAULT '', + physical_speed varchar(255) DEFAULT '', + physical_units varchar(255) DEFAULT '', + port_description varchar(255) DEFAULT '', + PRIMARY KEY (hostname,port_name_ft) +) ; -- --- Table structure for table `POLICY_UPDATE_NOTIFICATION` +-- Table structure for table POLICY_UPDATE_NOTIFICATION -- -CREATE TABLE `POLICY_UPDATE_NOTIFICATION` ( - `policy_name` varchar(255) NOT NULL, - `version_id` varchar(255) NOT NULL, - `update_type` varchar(255) NOT NULL, - `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`policy_name`,`version_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE POLICY_UPDATE_NOTIFICATION ( + policy_name varchar(255) NOT NULL, + version_id varchar(255) NOT NULL, + update_type varchar(255) NOT NULL, + timestamp timestamp DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (policy_name,version_id) +) ; + +-- +-- Table structure for table PORTAL_USERS +-- + +CREATE TABLE PORTAL_USERS ( + email varchar(64) NOT NULL, + password varchar(255) for bit data NOT NULL, + privilege char(1) NOT NULL, + PRIMARY KEY (email) +) ; + + +-- +-- Table structure for table PREPARE_FILE_RELATIONSHIP +-- + +CREATE TABLE PREPARE_FILE_RELATIONSHIP ( + prepare_file_relationship_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_instance_id varchar(50) DEFAULT NULL, + request_id varchar(255) DEFAULT NULL, + config_file_id int DEFAULT NULL, + asdc_artifacts_id int DEFAULT NULL, + PRIMARY KEY (prepare_file_relationship_id) +) ; + +-- +-- Table structure for table PRE_LOAD_VNF_DATA +-- + +CREATE TABLE PRE_LOAD_VNF_DATA ( + id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + svc_request_id varchar(100) DEFAULT '', + svc_action varchar(40) DEFAULT '', + status varchar(10) NOT NULL DEFAULT 'pending', + filename varchar(100) NOT NULL, + ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + preload_data blob, + PRIMARY KEY (id) +) ; -- --- Table structure for table `PORTAL_USERS` +-- Table structure for table PRE_LOAD_VNF_NETWORK_DATA -- -CREATE TABLE `PORTAL_USERS` ( - `email` varchar(64) NOT NULL, - `password` varbinary(255) NOT NULL, - `privilege` char(1) NOT NULL, - PRIMARY KEY (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE PRE_LOAD_VNF_NETWORK_DATA ( + id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + svc_request_id varchar(100) DEFAULT '', + svc_action varchar(40) DEFAULT '', + status varchar(10) NOT NULL DEFAULT 'pending', + filename varchar(100) NOT NULL, + ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + preload_data blob, + PRIMARY KEY (id) +) ; +-- +-- Table structure for table PSERVER +-- +CREATE TABLE PSERVER ( + hostname varchar(255) NOT NULL, + ptnii_equip_name varchar(255) DEFAULT '', + number_of_cpus varchar(255) DEFAULT '', + disk_in_gigabytes varchar(255) DEFAULT '', + ram_in_megabytes varchar(255) DEFAULT '', + equip_type varchar(255) DEFAULT '', + equip_vendor varchar(255) DEFAULT '', + equip_model varchar(255) DEFAULT '', + fqdn varchar(255) DEFAULT '', + pserver_selflink varchar(255) DEFAULT '', + ipv4_oam_address varchar(40) DEFAULT NULL, + serial_number varchar(255) DEFAULT '', + pserver_id varchar(255) DEFAULT '', + internet_topology varchar(40) DEFAULT '', + aic_site_id varchar(100) DEFAULT '', + in_maint varchar(5) DEFAULT '', + pserver_name2 varchar(255) DEFAULT '', + purpose varchar(255) DEFAULT '', + PRIMARY KEY (hostname) +) ; + +-- +-- Table structure for table RANGE_RULE -- --- Table structure for table `PREPARE_FILE_RELATIONSHIP` --- - -CREATE TABLE `PREPARE_FILE_RELATIONSHIP` ( - `prepare_file_relationship_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(50) DEFAULT NULL, - `request_id` varchar(255) DEFAULT NULL, - `config_file_id` int(11) DEFAULT NULL, - `asdc_artifacts_id` int(11) DEFAULT NULL, - PRIMARY KEY (`prepare_file_relationship_id`), - UNIQUE KEY `prepare_file_relationship_id` (`prepare_file_relationship_id`), - KEY `ie_prepare_file_relationship` (`config_file_id`), - KEY `ie2_prepare_file_relationship` (`asdc_artifacts_id`), - CONSTRAINT `prepare_file_relationship_ibfk_2` FOREIGN KEY (`asdc_artifacts_id`) REFERENCES `ASDC_ARTIFACTS` (`asdc_artifacts_id`) ON DELETE NO ACTION ON UPDATE CASCADE, - CONSTRAINT `prepare_file_replationship_ibfk_1` FOREIGN KEY (`config_file_id`) REFERENCES `CONFIGFILES` (`config_file_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PRE_LOAD_VNF_DATA` --- - -CREATE TABLE `PRE_LOAD_VNF_DATA` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `svc_request_id` varchar(100) DEFAULT '', - `svc_action` varchar(40) DEFAULT '', - `status` varchar(10) NOT NULL DEFAULT 'pending', - `filename` varchar(100) NOT NULL, - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `preload_data` longblob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=295 DEFAULT CHARSET=latin1; + +CREATE TABLE RANGE_RULE ( + range_rule_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + range_name varchar(50) NOT NULL, + service_model varchar(50) NOT NULL, + end_point_position varchar(50) NOT NULL, + equipment_level varchar(50) NOT NULL, + min_value int NOT NULL, + max_value int NOT NULL, + PRIMARY KEY (range_rule_id) +) ; -- --- Table structure for table `PRE_LOAD_VNF_NETWORK_DATA` +-- Table structure for table REQUEST_DETAILS -- -CREATE TABLE `PRE_LOAD_VNF_NETWORK_DATA` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `svc_request_id` varchar(100) DEFAULT '', - `svc_action` varchar(40) DEFAULT '', - `status` varchar(10) NOT NULL DEFAULT 'pending', - `filename` varchar(100) NOT NULL, - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `preload_data` longblob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=278 DEFAULT CHARSET=latin1; +CREATE TABLE REQUEST_DETAILS ( + request_id varchar(255) NOT NULL, + controller_id varchar(255) DEFAULT NULL, + status varchar(255) DEFAULT NULL, + service_rate varchar(255) DEFAULT NULL, + service_instance_id varchar(255) DEFAULT NULL, + service_type varchar(255) DEFAULT NULL, + global_customer_id varchar(255) DEFAULT NULL, + notification_url varchar(255) DEFAULT NULL, + domain_requests varchar(255) DEFAULT NULL, + PRIMARY KEY (request_id) +) ; + +-- +-- Table structure for table REQUEST_PROGRESS +-- + +CREATE TABLE REQUEST_PROGRESS ( + request_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_type varchar(20) DEFAULT NULL, + service_instance_id varchar(80) NOT NULL, + request_instance_type varchar(20) NOT NULL, + originating_service_instance_id varchar(80) DEFAULT NULL, + originating_service_type varchar(20) DEFAULT NULL, + overall_status varchar(20) DEFAULT NULL, + status_date varchar(80) DEFAULT NULL, + message varchar(255) DEFAULT NULL, + PRIMARY KEY (request_id) +) ; -- --- Table structure for table `PSERVER` +-- Table structure for table REQUEST_PROGRESS_STATE -- -CREATE TABLE `PSERVER` ( - `hostname` varchar(255) NOT NULL, - `ptnii_equip_name` varchar(255) DEFAULT '', - `number_of_cpus` varchar(255) DEFAULT '', - `disk_in_gigabytes` varchar(255) DEFAULT '', - `ram_in_megabytes` varchar(255) DEFAULT '', - `equip_type` varchar(255) DEFAULT '', - `equip_vendor` varchar(255) DEFAULT '', - `equip_model` varchar(255) DEFAULT '', - `fqdn` varchar(255) DEFAULT '', - `pserver_selflink` varchar(255) DEFAULT '', - `ipv4_oam_address` varchar(40) DEFAULT NULL, - `serial_number` varchar(255) DEFAULT '', - `pserver_id` varchar(255) DEFAULT '', - `internet_topology` varchar(40) DEFAULT '', - `aic_site_id` varchar(100) DEFAULT '', - `in_maint` varchar(5) DEFAULT '', - `pserver_name2` varchar(255) DEFAULT '', - `purpose` varchar(255) DEFAULT '', - PRIMARY KEY (`hostname`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE REQUEST_PROGRESS_STATE ( + request_progress_state_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_id int DEFAULT NULL, + service_instance_id varchar(80) NOT NULL, + request_instance_type varchar(20) NOT NULL, + progress_state varchar(30) DEFAULT NULL, + transaction_status varchar(20) DEFAULT NULL, + status_date varchar(80) DEFAULT NULL, + response_code varchar(20) DEFAULT NULL, + message varchar(255) DEFAULT NULL, + PRIMARY KEY (request_progress_state_id) +) ; -- --- Table structure for table `RANGE_RULE` +-- Table structure for table RESOURCE -- -CREATE TABLE `RANGE_RULE` ( - `range_rule_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `range_name` varchar(50) NOT NULL, - `service_model` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `equipment_level` varchar(50) NOT NULL, - `min_value` int(11) NOT NULL, - `max_value` int(11) NOT NULL, - PRIMARY KEY (`range_rule_id`) -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_DETAILS` --- - -CREATE TABLE `REQUEST_DETAILS` ( - `request_id` varchar(255) NOT NULL, - `controller_id` varchar(255) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `service_rate` varchar(255) DEFAULT NULL, - `service_instance_id` varchar(255) DEFAULT NULL, - `service_type` varchar(255) DEFAULT NULL, - `global_customer_id` varchar(255) DEFAULT NULL, - `notification_url` varchar(255) DEFAULT NULL, - `domain_requests` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_PROGRESS` --- - -CREATE TABLE `REQUEST_PROGRESS` ( - `request_id` int(11) NOT NULL AUTO_INCREMENT, - `request_type` varchar(20) DEFAULT NULL, - `service_instance_id` varchar(80) NOT NULL, - `request_instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `overall_status` varchar(20) DEFAULT NULL, - `status_date` varchar(80) DEFAULT NULL, - `message` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_PROGRESS_STATE` --- - -CREATE TABLE `REQUEST_PROGRESS_STATE` ( - `request_progress_state_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` int(11) DEFAULT NULL, - `service_instance_id` varchar(80) NOT NULL, - `request_instance_type` varchar(20) NOT NULL, - `progress_state` varchar(30) DEFAULT NULL, - `transaction_status` varchar(20) DEFAULT NULL, - `status_date` varchar(80) DEFAULT NULL, - `response_code` varchar(20) DEFAULT NULL, - `message` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_progress_state_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE` +CREATE TABLE RESOURCE ( + resource_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + asset_id varchar(100) NOT NULL, + resource_name varchar(50) NOT NULL, + resource_type varchar(5) NOT NULL CONSTRAINT res_ck CHECK(resource_type IN ('Limit','Label','Range')), + lt_used bigint DEFAULT NULL, + ll_label varchar(50) DEFAULT NULL, + ll_reference_count smallint DEFAULT NULL, + rr_used varchar(4000) DEFAULT NULL, + PRIMARY KEY (resource_id) +) ; + -- - -CREATE TABLE `RESOURCE` ( - `resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `asset_id` varchar(100) NOT NULL, - `resource_name` varchar(50) NOT NULL, - `resource_type` enum('Limit','Label','Range') NOT NULL, - `lt_used` bigint(20) DEFAULT NULL, - `ll_label` varchar(50) DEFAULT NULL, - `ll_reference_count` smallint(6) DEFAULT NULL, - `rr_used` varchar(4000) DEFAULT NULL, - PRIMARY KEY (`resource_id`), - UNIQUE KEY `resource_id` (`resource_id`), - UNIQUE KEY `IX1_RESOURCE` (`asset_id`,`resource_name`) -) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1; +-- Table structure for table RESOURCE_LOAD +-- + +CREATE TABLE RESOURCE_LOAD ( + resource_load_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + resource_id bigint NOT NULL, + application_id varchar(20) NOT NULL, + resource_load_time timestamp NOT NULL, + resource_expiration_time timestamp DEFAULT NULL, + PRIMARY KEY (resource_load_id) +) ; -- --- Table structure for table `RESOURCE_LOAD` +-- Table structure for table RESOURCE_LOCK -- -CREATE TABLE `RESOURCE_LOAD` ( - `resource_load_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_id` bigint(20) NOT NULL, - `application_id` varchar(20) NOT NULL, - `resource_load_time` datetime NOT NULL, - `resource_expiration_time` datetime DEFAULT NULL, - PRIMARY KEY (`resource_load_id`), - UNIQUE KEY `resource_load_id` (`resource_load_id`), - UNIQUE KEY `IX2_RESOURCE_LOAD` (`resource_id`,`application_id`), - KEY `IX1_RESOURCE_LOAD` (`resource_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE RESOURCE_LOCK ( + resource_lock_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + resource_name varchar(256) DEFAULT NULL, + lock_holder varchar(100) NOT NULL, + lock_count smallint NOT NULL, + lock_time timestamp NOT NULL, + expiration_time timestamp NOT NULL, + PRIMARY KEY (resource_lock_id) +) ; -- --- Table structure for table `RESOURCE_LOCK` +-- Table structure for table RESOURCE_RULE -- -CREATE TABLE `RESOURCE_LOCK` ( - `resource_lock_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_name` varchar(256) DEFAULT NULL, - `lock_holder` varchar(100) NOT NULL, - `lock_count` smallint(6) NOT NULL, - `lock_time` datetime NOT NULL, - `expiration_time` datetime NOT NULL, - PRIMARY KEY (`resource_lock_id`), - UNIQUE KEY `resource_lock_id` (`resource_lock_id`), - UNIQUE KEY `IX1_RESOURCE_LOCK` (`resource_name`) -) ENGINE=InnoDB AUTO_INCREMENT=29681 DEFAULT CHARSET=latin1; +CREATE TABLE RESOURCE_RULE ( + resource_rule_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + resource_name varchar(50) NOT NULL, + service_model varchar(50) NOT NULL, + end_point_position varchar(50) NOT NULL, + service_expression varchar(2000) NOT NULL, + equipment_level varchar(50) NOT NULL, + equipment_expression varchar(2000) NOT NULL, + allocation_expression varchar(2000) NOT NULL, + soft_limit_expression varchar(2000) NOT NULL, + hard_limit_expression varchar(2000) NOT NULL, + PRIMARY KEY (resource_rule_id) +) ; -- --- Table structure for table `RESOURCE_RULE` +-- Table structure for table RESOURCE_THRESHOLD -- -CREATE TABLE `RESOURCE_RULE` ( - `resource_rule_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_name` varchar(50) NOT NULL, - `service_model` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `service_expression` varchar(2000) NOT NULL, - `equipment_level` varchar(50) NOT NULL, - `equipment_expression` varchar(2000) NOT NULL, - `allocation_expression` varchar(2000) NOT NULL, - `soft_limit_expression` varchar(2000) NOT NULL, - `hard_limit_expression` varchar(2000) NOT NULL, - PRIMARY KEY (`resource_rule_id`), - UNIQUE KEY `resource_rule_id` (`resource_rule_id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1; +CREATE TABLE RESOURCE_THRESHOLD ( + resource_threshold_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + resource_rule_id bigint NOT NULL, + threshold_expression varchar(2000) NOT NULL, + threshold_message varchar(2000) NOT NULL, + PRIMARY KEY (resource_threshold_id) +) ; -- --- Table structure for table `RESOURCE_THRESHOLD` +-- Table structure for table ROUTER_MASTER -- -CREATE TABLE `RESOURCE_THRESHOLD` ( - `resource_threshold_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_rule_id` bigint(20) NOT NULL, - `threshold_expression` varchar(2000) NOT NULL, - `threshold_message` varchar(2000) NOT NULL, - PRIMARY KEY (`resource_threshold_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; +CREATE TABLE ROUTER_MASTER ( + crs_name varchar(20) NOT NULL, + loopback_ip varchar(20) NOT NULL, + PRIMARY KEY (crs_name) +) ; -- --- Table structure for table `ROUTER_MASTER` +-- Table structure for table ROUTING_CHARACTERISTIC_MAPPING -- -CREATE TABLE `ROUTER_MASTER` ( - `crs_name` varchar(20) NOT NULL, - `loopback_ip` varchar(20) NOT NULL, - PRIMARY KEY (`crs_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE ROUTING_CHARACTERISTIC_MAPPING ( + network_role varchar(255) NOT NULL, + vrf_name varchar(255) NOT NULL, + routing_characteristic varchar(255) NOT NULL, + PRIMARY KEY (network_role,vrf_name) +) ; -- --- Table structure for table `ROUTING_CHARACTERISTIC_MAPPING` +-- Table structure for table SERVICE_HOMING -- -CREATE TABLE `ROUTING_CHARACTERISTIC_MAPPING` ( - `network_role` varchar(255) NOT NULL, - `vrf_name` varchar(255) NOT NULL, - `routing_characteristic` varchar(255) NOT NULL, - PRIMARY KEY (`network_role`,`vrf_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_HOMING ( + service_type varchar(100) NOT NULL, + lata int NOT NULL, + hubbing_city_type varchar(40) NOT NULL, + latitude float DEFAULT NULL, + longitude float DEFAULT NULL, + primary_aic_site_name varchar(100) NOT NULL, + secondary_aic_site_name varchar(100) DEFAULT NULL, + tertiary_aic_site_name varchar(100) DEFAULT NULL, + PRIMARY KEY (service_type,lata,hubbing_city_type) +) ; -- --- Table structure for table `SERVICE_HOMING` +-- Table structure for table SERVICE_HOMING_BACKUP -- -CREATE TABLE `SERVICE_HOMING` ( - `service_type` varchar(100) NOT NULL, - `lata` int(3) NOT NULL, - `hubbing_city_type` varchar(40) NOT NULL, - `latitude` float DEFAULT NULL, - `longitude` float DEFAULT NULL, - `primary_aic_site_name` varchar(100) NOT NULL, - `secondary_aic_site_name` varchar(100) DEFAULT NULL, - `tertiary_aic_site_name` varchar(100) DEFAULT NULL, - PRIMARY KEY (`service_type`,`lata`,`hubbing_city_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_HOMING_BACKUP ( + service_type varchar(100) NOT NULL, + lata int NOT NULL, + hubbing_city_type varchar(40) NOT NULL, + latitude float DEFAULT NULL, + longitude float DEFAULT NULL, + primary_aic_site_name varchar(100) NOT NULL, + secondary_aic_site_name varchar(100) DEFAULT NULL, + tertiary_aic_site_name varchar(100) DEFAULT NULL, + PRIMARY KEY (service_type,lata,hubbing_city_type) +) ; -- --- Table structure for table `SERVICE_HOMING_BACKUP` +-- Table structure for table SERVICE_INSTANCE_NAME_INDEX -- -CREATE TABLE `SERVICE_HOMING_BACKUP` ( - `service_type` varchar(100) NOT NULL, - `lata` int(3) NOT NULL, - `hubbing_city_type` varchar(40) NOT NULL, - `latitude` float DEFAULT NULL, - `longitude` float DEFAULT NULL, - `primary_aic_site_name` varchar(100) NOT NULL, - `secondary_aic_site_name` varchar(100) DEFAULT NULL, - `tertiary_aic_site_name` varchar(100) DEFAULT NULL, - PRIMARY KEY (`service_type`,`lata`,`hubbing_city_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_INSTANCE_NAME_INDEX ( + service_instance_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (service_instance_name_prefix) +) ; -- --- Table structure for table `SERVICE_INSTANCE_NAME_INDEX` +-- Table structure for table SERVICE_MANAGER_CREDENTIALS -- -CREATE TABLE `SERVICE_INSTANCE_NAME_INDEX` ( - `service_instance_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`service_instance_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_MANAGER_CREDENTIALS ( + service_manager_username varchar(255) NOT NULL, + service_manager_password varchar(255) for bit data NOT NULL, + PRIMARY KEY (service_manager_username) +) ; -- --- Table structure for table `SERVICE_MANAGER_CREDENTIALS` +-- Table structure for table SERVICE_PROXY -- -CREATE TABLE `SERVICE_MANAGER_CREDENTIALS` ( - `service_manager_username` varchar(255) NOT NULL, - `service_manager_password` varbinary(255) NOT NULL, - PRIMARY KEY (`service_manager_username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_PROXY ( + port_mirror_service_uuid varchar(255) NOT NULL, + service_proxy_name varchar(255) NOT NULL, + source_service_uuid varchar(255) NOT NULL, + resources_vendor varchar(255) DEFAULT NULL, + resource_vendor_release varchar(255) DEFAULT NULL, + description varchar(255) DEFAULT NULL, + category varchar(255) DEFAULT NULL, + subcategory varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + role varchar(255) NOT NULL, + uuid varchar(255) DEFAULT NULL, + customization_uuid varchar(255) DEFAULT NULL, + invariant_uuid varchar(255) DEFAULT NULL, + PRIMARY KEY (port_mirror_service_uuid,service_proxy_name) +) ; -- --- Table structure for table `SERVICE_PROXY` +-- Table structure for table SERVICE_RESOURCE -- -CREATE TABLE `SERVICE_PROXY` ( - `port_mirror_service_uuid` varchar(255) NOT NULL, - `service_proxy_name` varchar(255) NOT NULL, - `source_service_uuid` varchar(255) NOT NULL, - `resources_vendor` varchar(255) DEFAULT NULL, - `resource_vendor_release` varchar(255) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `category` varchar(255) DEFAULT NULL, - `subcategory` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `role` varchar(255) NOT NULL, - `uuid` varchar(255) DEFAULT NULL, - `customization_uuid` varchar(255) DEFAULT NULL, - `invariant_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`port_mirror_service_uuid`,`service_proxy_name`), - KEY `FK_SERVICE_PROXY_SOURCE_TO_SERVICE_MODE` (`source_service_uuid`), - CONSTRAINT `FK_SERVICE_PROXY_MIRROR_TO_SERVICE_MODE` FOREIGN KEY (`port_mirror_service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_RESOURCE ( + service_resource_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + service_instance_id varchar(80) NOT NULL, + service_status varchar(7) NOT NULL CONSTRAINT svc_stat_ck CHECK (service_status IN ('Active','Pending')), + service_change_number smallint NOT NULL, + resource_set_id varchar(100) NOT NULL, + resource_union_id varchar(100) NOT NULL, + PRIMARY KEY (service_instance_id,service_change_number) +) ; -- --- Table structure for table `SERVICE_RESOURCE` +-- Table structure for table SERVICE_TYPE_MAPPING -- -CREATE TABLE `SERVICE_RESOURCE` ( - `service_resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `service_status` enum('Active','Pending') NOT NULL, - `service_change_number` smallint(6) NOT NULL, - `resource_set_id` varchar(100) NOT NULL, - `resource_union_id` varchar(100) NOT NULL, - PRIMARY KEY (`service_instance_id`,`service_change_number`), - UNIQUE KEY `service_resource_id` (`service_resource_id`), - KEY `IX1_SERVICE_RESOURCE` (`service_instance_id`) -) ENGINE=InnoDB AUTO_INCREMENT=955 DEFAULT CHARSET=latin1; +CREATE TABLE SERVICE_TYPE_MAPPING ( + sdnc_service_type varchar(128) NOT NULL, + ncs_service_type varchar(128) NOT NULL, + PRIMARY KEY (sdnc_service_type,ncs_service_type) +) ; -- --- Table structure for table `SERVICE_TYPE_MAPPING` +-- Table structure for table SUBNETPOOL_MAPPING -- -CREATE TABLE `SERVICE_TYPE_MAPPING` ( - `sdnc_service_type` varchar(128) NOT NULL, - `ncs_service_type` varchar(128) NOT NULL, - PRIMARY KEY (`sdnc_service_type`,`ncs_service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SUBNETPOOL_MAPPING ( + aic_cloud_region varchar(16) NOT NULL, + ntc varchar(32) NOT NULL, + lcp varchar(32) NOT NULL, + aic_region_id varchar(255) NOT NULL, + PRIMARY KEY (aic_cloud_region) +) ; -- --- Table structure for table `SUBNETPOOL_MAPPING` +-- Table structure for table SUPPORTED_SEQUENCE_NUMBER -- -CREATE TABLE `SUBNETPOOL_MAPPING` ( - `aic_cloud_region` varchar(16) NOT NULL, - `ntc` varchar(32) NOT NULL, - `lcp` varchar(32) NOT NULL, - `aic_region_id` varchar(255) NOT NULL, - PRIMARY KEY (`aic_cloud_region`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SUPPORTED_SEQUENCE_NUMBER ( + resource_sequence_number varchar(10) NOT NULL, + resource_type varchar(10) NOT NULL, + PRIMARY KEY (resource_sequence_number,resource_type) +) ; -- --- Table structure for table `SUPPORTED_SEQUENCE_NUMBER` +-- Table structure for table SVC_LOGIC -- -CREATE TABLE `SUPPORTED_SEQUENCE_NUMBER` ( - `resource_sequence_number` varchar(10) NOT NULL, - `resource_type` varchar(10) NOT NULL, - PRIMARY KEY (`resource_sequence_number`,`resource_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE SVC_LOGIC ( + module varchar(80) NOT NULL, + rpc varchar(80) NOT NULL, + version varchar(40) NOT NULL, + mode varchar(5) NOT NULL, + active varchar(1) NOT NULL, + graph blob, + modified_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + md5sum varchar(128) DEFAULT NULL, + PRIMARY KEY (module,rpc,version,mode) +) ; -- --- Table structure for table `SVC_LOGIC` +-- Table structure for table TABLE_CLEANUP_CONFIGURATION -- -CREATE TABLE `SVC_LOGIC` ( - `module` varchar(80) NOT NULL, - `rpc` varchar(80) NOT NULL, - `version` varchar(40) NOT NULL, - `mode` varchar(5) NOT NULL, - `active` varchar(1) NOT NULL, - `graph` longblob, - `modified_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `md5sum` varchar(128) DEFAULT NULL, - PRIMARY KEY (`module`,`rpc`,`version`,`mode`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TABLE_CLEANUP_CONFIGURATION ( + table_name varchar(255) NOT NULL, + days_old int NOT NULL , + date_column varchar(255) NOT NULL , + commit_interval int NOT NULL DEFAULT 2500 , + query_clause varchar(1000) DEFAULT NULL , + child_table_name varchar(255) DEFAULT NULL, + child_table_pk varchar(255) DEFAULT NULL, + PRIMARY KEY (table_name) +) ; -- --- Table structure for table `TABLE_CLEANUP_CONFIGURATION` +-- Table structure for table TASK_TEMPLATE -- -CREATE TABLE `TABLE_CLEANUP_CONFIGURATION` ( - `table_name` varchar(255) NOT NULL COMMENT 'The name of the table the cleanup will be performed on', - `days_old` int(11) NOT NULL COMMENT 'Records older than the current date minus DAYS_OLD will be deleted', - `date_column` varchar(255) NOT NULL COMMENT 'The name of the column containing the date to be checked', - `commit_interval` int(11) NOT NULL DEFAULT '2500' COMMENT 'The maximum number of rows a commit may contain', - `query_clause` varchar(1000) DEFAULT NULL COMMENT 'An optional additional query clause to further restrict deletion criteria', - `child_table_name` varchar(255) DEFAULT NULL, - `child_table_pk` varchar(255) DEFAULT NULL, - PRIMARY KEY (`table_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table will be used by the table clean-up script, tableCleanup.sh, to drive what tables should be purged and what the purge criteria are.'; +CREATE TABLE TASK_TEMPLATE ( + task_template_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_type varchar(20) DEFAULT NULL, + task_name varchar(30) NOT NULL, + task_category varchar(50) NOT NULL, + ecomp_task varchar(50) NOT NULL, + initial_load varchar(1) NOT NULL, + service varchar(20) DEFAULT NULL, + PRIMARY KEY (task_template_id) +) ; -- --- Table structure for table `TASK_TEMPLATE` +-- Table structure for table TENANT -- -CREATE TABLE `TASK_TEMPLATE` ( - `task_template_id` int(11) NOT NULL AUTO_INCREMENT, - `request_type` varchar(20) DEFAULT NULL, - `task_name` varchar(30) NOT NULL, - `task_category` varchar(50) NOT NULL, - `ecomp_task` varchar(50) NOT NULL, - `initial_load` varchar(1) NOT NULL, - `service` varchar(20) DEFAULT NULL, - PRIMARY KEY (`task_template_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; +CREATE TABLE TENANT ( + tenant_id varchar(255) NOT NULL, + tenant_name varchar(255) NOT NULL, + service_instance_id varchar(255) NOT NULL, + PRIMARY KEY (tenant_id,tenant_name) +) ; -- --- Table structure for table `TENANT` +-- Table structure for table TESTTBL -- -CREATE TABLE `TENANT` ( - `tenant_id` varchar(255) NOT NULL, - `tenant_name` varchar(255) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - PRIMARY KEY (`tenant_id`,`tenant_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TESTTBL ( + pk varchar(25) NOT NULL, + col1 varchar(25) DEFAULT NULL +) ; -- --- Table structure for table `TESTTBL` +-- Table structure for table THRESHOLD_NOTIFICATION -- -CREATE TABLE `TESTTBL` ( - `pk` varchar(25) NOT NULL, - `col1` varchar(25) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE THRESHOLD_NOTIFICATION ( + resource_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + threshold_expression varchar(2000) DEFAULT NULL, + threshold_message varchar(500) DEFAULT NULL, + PRIMARY KEY (resource_id) +) ; -- --- Table structure for table `THRESHOLD_NOTIFICATION` +-- Table structure for table TMP_AIC_AVAIL_ZONE_POOL -- -CREATE TABLE `THRESHOLD_NOTIFICATION` ( - `resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `threshold_expression` varchar(2000) DEFAULT NULL, - `threshold_message` varchar(500) DEFAULT NULL, - PRIMARY KEY (`resource_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TMP_AIC_AVAIL_ZONE_POOL ( + aic_site_id varchar(100) NOT NULL, + status varchar(40) NOT NULL, + availability_zone varchar(100) NOT NULL, + token int NOT NULL, + vnf_id varchar(80) DEFAULT NULL, + service_type varchar(100) NOT NULL, + vnf_type varchar(20) DEFAULT NULL, + hypervisor varchar(10) DEFAULT NULL, + PRIMARY KEY (aic_site_id,availability_zone,token) +) ; -- --- Table structure for table `TMP_AIC_AVAIL_ZONE_POOL` +-- Table structure for table TOPOLOGY_PARAMETER -- -CREATE TABLE `TMP_AIC_AVAIL_ZONE_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `status` varchar(40) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `token` int(4) NOT NULL, - `vnf_id` varchar(80) DEFAULT NULL, - `service_type` varchar(100) NOT NULL, - `vnf_type` varchar(20) DEFAULT NULL, - `hypervisor` varchar(10) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TOPOLOGY_PARAMETER ( + parameter_id int NOT NULL, + parameter_name varchar(20) NOT NULL, + parameter_set int NOT NULL, + create_update_time timestamp NOT NULL, + create_update_user varchar(40) NOT NULL, + PRIMARY KEY (parameter_id) +) ; -- --- Table structure for table `TOPOLOGY_PARAMETER` +-- Table structure for table TOPOLOGY_PARAMETER_ENTRIES -- -CREATE TABLE `TOPOLOGY_PARAMETER` ( - `parameter_id` int(11) NOT NULL, - `parameter_name` varchar(20) NOT NULL, - `parameter_set` int(11) NOT NULL, - `create_update_time` datetime NOT NULL, - `create_update_user` varchar(40) NOT NULL, - PRIMARY KEY (`parameter_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TOPOLOGY_PARAMETER_ENTRIES ( + parameter_entry_id int NOT NULL, + parameter_name varchar(255) NOT NULL, + parameter_value varchar(64) NOT NULL, + create_update_time timestamp NOT NULL, + create_update_user varchar(40) NOT NULL, + PRIMARY KEY (parameter_entry_id) +) ; -- --- Table structure for table `TOPOLOGY_PARAMETER_ENTRIES` +-- Table structure for table TOPOLOGY_PARAMETER_TO_ENTRIES -- -CREATE TABLE `TOPOLOGY_PARAMETER_ENTRIES` ( - `parameter_entry_id` int(11) NOT NULL, - `parameter_name` varchar(255) NOT NULL, - `parameter_value` varchar(64) NOT NULL, - `create_update_time` datetime NOT NULL, - `create_update_user` varchar(40) NOT NULL, - PRIMARY KEY (`parameter_entry_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TOPOLOGY_PARAMETER_TO_ENTRIES ( + parameter_id int DEFAULT NULL, + parameter_entry_id int DEFAULT NULL, + entry_order int DEFAULT NULL, + create_update_time timestamp DEFAULT NULL, + create_update_user varchar(40) NOT NULL +) ; -- --- Table structure for table `TOPOLOGY_PARAMETER_TO_ENTRIES` +-- Table structure for table TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE -- -CREATE TABLE `TOPOLOGY_PARAMETER_TO_ENTRIES` ( - `parameter_id` int(11) DEFAULT NULL, - `parameter_entry_id` int(11) DEFAULT NULL, - `entry_order` int(11) DEFAULT NULL, - `create_update_time` datetime DEFAULT NULL, - `create_update_user` varchar(40) NOT NULL, - KEY `FK1_TOPOLOGY_PARAMETER_TO_ENTRIES` (`parameter_id`), - KEY `FK2_TOPOLOGY_PARAMETER_TO_ENTRIES` (`parameter_entry_id`), - CONSTRAINT `FK1_TOPOLOGY_PARAMETER_TO_ENTRIES` FOREIGN KEY (`parameter_id`) REFERENCES `TOPOLOGY_PARAMETER` (`parameter_id`), - CONSTRAINT `FK2_TOPOLOGY_PARAMETER_TO_ENTRIES` FOREIGN KEY (`parameter_entry_id`) REFERENCES `TOPOLOGY_PARAMETER_ENTRIES` (`parameter_entry_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE ( + interface_name varchar(255) NOT NULL, + interface_id varchar(255) NOT NULL, + pnf_name varchar(255) NOT NULL, + pnf_id varchar(255) NOT NULL, + controller_id varchar(255) DEFAULT NULL, + rate varchar(255) DEFAULT NULL, + clli varchar(255) DEFAULT NULL, + connection_point varchar(255) DEFAULT NULL, + PRIMARY KEY (interface_name) +) ; -- --- Table structure for table `TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE` +-- Table structure for table TRANSACTION_LOG -- -CREATE TABLE `TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE` ( - `interface_name` varchar(255) NOT NULL, - `interface_id` varchar(255) NOT NULL, - `pnf_name` varchar(255) NOT NULL, - `pnf_id` varchar(255) NOT NULL, - `controller_id` varchar(255) DEFAULT NULL, - `rate` varchar(255) DEFAULT NULL, - `clli` varchar(255) DEFAULT NULL, - `connection_point` varchar(255) DEFAULT NULL, - PRIMARY KEY (`interface_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE TRANSACTION_LOG ( + serial_key int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + log_time varchar(40) NOT NULL, + request_id varchar(80) DEFAULT NULL, + svc_request_id varchar(80) DEFAULT NULL, + x_ecomp_request_id varchar(80) DEFAULT NULL, + graph_name varchar(255) DEFAULT NULL, + PRIMARY KEY (serial_key) +) ; + -- --- Table structure for table `TRANSACTION_LOG` +-- Table structure for table UPLOAD_CONFIG -- -CREATE TABLE `TRANSACTION_LOG` ( - `serial_key` int(10) NOT NULL AUTO_INCREMENT, - `log_time` varchar(40) NOT NULL, - `request_id` varchar(80) DEFAULT NULL, - `svc_request_id` varchar(80) DEFAULT NULL, - `x_ecomp_request_id` varchar(80) DEFAULT NULL, - `graph_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`serial_key`) -) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=latin1; +CREATE TABLE UPLOAD_CONFIG ( + upload_config_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + request_id varchar(50) DEFAULT NULL, + originator_id varchar(50) DEFAULT NULL, + service_description varchar(100) DEFAULT NULL, + action varchar(50) DEFAULT NULL, + upload_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + vnf_id varchar(50) DEFAULT NULL, + vnf_name varchar(50) DEFAULT NULL, + vm_name varchar(50) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + vnfc_type varchar(50) DEFAULT NULL, + host_ip_address varchar(50) DEFAULT NULL, + config_indicator varchar(25) DEFAULT NULL, + pending_delete varchar(1) DEFAULT NULL, + content long varchar, + PRIMARY KEY (upload_config_id) +) ; + +-- +-- Table structure for table USED_SEQUENCE_NUMBER +-- +CREATE TABLE USED_SEQUENCE_NUMBER ( + resource_sequence_number varchar(10) NOT NULL, + resource_type varchar(10) NOT NULL, + zone_region_id varchar(50) NOT NULL, + PRIMARY KEY (resource_sequence_number,resource_type,zone_region_id) +) ; + + +-- +-- Table structure for table VENDOR_CODE +-- + +CREATE TABLE VENDOR_CODE ( + vendor_code varchar(1) NOT NULL, + vendor varchar(45) NOT NULL DEFAULT '', + PRIMARY KEY (vendor_code,vendor) +) ; + +-- +-- Table structure for table VFC_MODEL +-- + +CREATE TABLE VFC_MODEL ( + customization_uuid varchar(255) NOT NULL, + model_yaml clob, + invariant_uuid varchar(255) DEFAULT NULL, + uuid varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + naming_policy varchar(255) DEFAULT NULL, + ecomp_generated_naming char(1) DEFAULT NULL, + nfc_function varchar(255) DEFAULT NULL, + nfc_naming_code varchar(255) DEFAULT NULL, + vm_type varchar(255) DEFAULT NULL, + vm_type_tag varchar(255) DEFAULT NULL, + vm_image_name varchar(255) DEFAULT NULL, + vm_flavor_name varchar(255) DEFAULT NULL, + high_availability varchar(255) DEFAULT NULL, + nfc_naming varchar(255) DEFAULT NULL, + min_instances int DEFAULT NULL, + max_instances int DEFAULT NULL, + PRIMARY KEY (customization_uuid) +) ; + +-- +-- Table structure for table VFC_TO_NETWORK_ROLE_MAPPING +-- + +CREATE TABLE VFC_TO_NETWORK_ROLE_MAPPING ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vfc_customization_uuid varchar(255) NOT NULL, + network_role varchar(255) NOT NULL, + vm_type varchar(255) DEFAULT NULL, + network_role_tag varchar(255) DEFAULT NULL, + ipv4_count int NOT NULL, + ipv6_count int NOT NULL, + ipv4_use_dhcp char(1) DEFAULT NULL, + ipv6_use_dhcp char(1) DEFAULT NULL, + ipv4_ip_version char(1) DEFAULT NULL, + ipv6_ip_version char(1) DEFAULT NULL, + extcp_subnetpool_id varchar(512) DEFAULT NULL, + ipv4_floating_count int DEFAULT NULL, + ipv6_floating_count int DEFAULT NULL, + ipv4_address_plan_name varchar(512) DEFAULT NULL, + ipv6_address_plan_name varchar(512) DEFAULT NULL, + ipv4_vrf_name varchar(512) DEFAULT NULL, + ipv6_vrf_name varchar(512) DEFAULT NULL, + subnet_role varchar(255) DEFAULT NULL, + subinterface_indicator char(1) DEFAULT NULL, + PRIMARY KEY (seq) +) ; -- --- Table structure for table `UPLOAD_CONFIG` +-- Table structure for table VF_MODEL +-- + +CREATE TABLE VF_MODEL ( + customization_uuid varchar(255) NOT NULL, + model_yaml clob, + invariant_uuid varchar(255) DEFAULT NULL, + uuid varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + name varchar(255) DEFAULT NULL, + naming_policy varchar(255) DEFAULT NULL, + ecomp_generated_naming char(1) DEFAULT NULL, + avail_zone_max_count int DEFAULT NULL, + nf_function varchar(255) DEFAULT NULL, + nf_code varchar(255) DEFAULT NULL, + nf_type varchar(255) DEFAULT NULL, + nf_role varchar(255) DEFAULT NULL, + vendor varchar(255) DEFAULT NULL, + vendor_version varchar(255) DEFAULT NULL, + PRIMARY KEY (customization_uuid) +) ; + +-- +-- Table structure for table VF_MODULE_MODEL -- -CREATE TABLE `UPLOAD_CONFIG` ( - `upload_config_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` varchar(50) DEFAULT NULL, - `originator_id` varchar(50) DEFAULT NULL, - `service_description` varchar(100) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `upload_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `vnf_id` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `host_ip_address` varchar(50) DEFAULT NULL, - `config_indicator` varchar(25) DEFAULT NULL, - `pending_delete` varchar(1) DEFAULT NULL, - `content` longtext, - PRIMARY KEY (`upload_config_id`), - UNIQUE KEY `upload_config_id` (`upload_config_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - --- --- Table structure for table `USED_SEQUENCE_NUMBER` --- - -CREATE TABLE `USED_SEQUENCE_NUMBER` ( - `resource_sequence_number` varchar(10) NOT NULL, - `resource_type` varchar(10) NOT NULL, - `zone_region_id` varchar(50) NOT NULL, - PRIMARY KEY (`resource_sequence_number`,`resource_type`,`zone_region_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `USER_TRACE` --- - -CREATE TABLE `USER_TRACE` ( - `user_trace_seq` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `identity` varchar(12) DEFAULT NULL, - `action` varchar(128) DEFAULT NULL, - `description` varchar(256) DEFAULT NULL, - PRIMARY KEY (`user_trace_seq`) -) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VENDOR_CODE` --- - -CREATE TABLE `VENDOR_CODE` ( - `vendor_code` varchar(1) NOT NULL, - `vendor` varchar(45) NOT NULL DEFAULT '', - PRIMARY KEY (`vendor_code`,`vendor`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VFC_MODEL` --- - -CREATE TABLE `VFC_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `nfc_function` varchar(255) DEFAULT NULL, - `nfc_naming_code` varchar(255) DEFAULT NULL, - `vm_type` varchar(255) DEFAULT NULL, - `vm_type_tag` varchar(255) DEFAULT NULL, - `vm_image_name` varchar(255) DEFAULT NULL, - `vm_flavor_name` varchar(255) DEFAULT NULL, - `high_availability` varchar(255) DEFAULT NULL, - `nfc_naming` varchar(255) DEFAULT NULL, - `min_instances` int(11) DEFAULT NULL, - `max_instances` int(11) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VFC_TO_NETWORK_ROLE_MAPPING` --- - -CREATE TABLE `VFC_TO_NETWORK_ROLE_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vfc_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `vm_type` varchar(255) DEFAULT NULL, - `network_role_tag` varchar(255) DEFAULT NULL, - `ipv4_count` int(11) NOT NULL, - `ipv6_count` int(11) NOT NULL, - `ipv4_use_dhcp` char(1) DEFAULT NULL, - `ipv6_use_dhcp` char(1) DEFAULT NULL, - `ipv4_ip_version` char(1) DEFAULT NULL, - `ipv6_ip_version` char(1) DEFAULT NULL, - `extcp_subnetpool_id` varchar(512) DEFAULT NULL, - `ipv4_floating_count` int(11) DEFAULT NULL, - `ipv6_floating_count` int(11) DEFAULT NULL, - `ipv4_address_plan_name` varchar(512) DEFAULT NULL, - `ipv6_address_plan_name` varchar(512) DEFAULT NULL, - `ipv4_vrf_name` varchar(512) DEFAULT NULL, - `ipv6_vrf_name` varchar(512) DEFAULT NULL, - `subnet_role` varchar(255) DEFAULT NULL, - `subinterface_indicator` char(1) DEFAULT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VFC_TO_NETWORK_ROLE_MAPPING` (`vfc_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=1791 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODEL` --- - -CREATE TABLE `VF_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `avail_zone_max_count` int(11) DEFAULT NULL, - `nf_function` varchar(255) DEFAULT NULL, - `nf_code` varchar(255) DEFAULT NULL, - `nf_type` varchar(255) DEFAULT NULL, - `nf_role` varchar(255) DEFAULT NULL, - `vendor` varchar(255) DEFAULT NULL, - `vendor_version` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODULE_MODEL` --- - -CREATE TABLE `VF_MODULE_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `vf_module_type` varchar(255) DEFAULT NULL, - `availability_zone_count` int(11) DEFAULT NULL, - `ecomp_generated_vm_assignments` char(1) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODULE_TO_VFC_MAPPING` --- - -CREATE TABLE `VF_MODULE_TO_VFC_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vf_module_customization_uuid` varchar(255) NOT NULL, - `vfc_customization_uuid` varchar(255) NOT NULL, - `vm_type` varchar(255) NOT NULL, - `vm_count` int(11) NOT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VF_MODULE_TO_VFC_MAPPING` (`vf_module_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=1591 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_TO_NETWORK_ROLE_MAPPING` --- - -CREATE TABLE `VF_TO_NETWORK_ROLE_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vf_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VF_TO_NETWORK_ROLE_MAPPING` (`vf_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=348 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VIPR_CONFIGURATION` --- - -CREATE TABLE `VIPR_CONFIGURATION` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `serial_number` varchar(255) DEFAULT NULL, - `vnf_id` varchar(255) DEFAULT NULL, - `vnf_name` varchar(255) DEFAULT NULL, - `ecomp_service_instance_id` varchar(255) DEFAULT NULL, - `vm_name` varchar(255) DEFAULT NULL, - `cloud_region_id` varchar(255) DEFAULT NULL, - `cloud_owner` varchar(255) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VIPR_SZ_MANAGER_KEY` --- +CREATE TABLE VF_MODULE_MODEL ( + customization_uuid varchar(255) NOT NULL, + model_yaml clob, + invariant_uuid varchar(255) DEFAULT NULL, + uuid varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + vf_module_type varchar(255) DEFAULT NULL, + availability_zone_count int DEFAULT NULL, + ecomp_generated_vm_assignments char(1) DEFAULT NULL, + PRIMARY KEY (customization_uuid) +) ; + +-- +-- Table structure for table VF_MODULE_TO_VFC_MAPPING +-- + +CREATE TABLE VF_MODULE_TO_VFC_MAPPING ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vf_module_customization_uuid varchar(255) NOT NULL, + vfc_customization_uuid varchar(255) NOT NULL, + vm_type varchar(255) NOT NULL, + vm_count int NOT NULL, + PRIMARY KEY (seq) +) ; + +-- +-- Table structure for table VF_TO_NETWORK_ROLE_MAPPING +-- + +CREATE TABLE VF_TO_NETWORK_ROLE_MAPPING ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + vf_customization_uuid varchar(255) NOT NULL, + network_role varchar(255) NOT NULL, + PRIMARY KEY (seq) +) ; + +-- +-- Table structure for table VIPR_CONFIGURATION +-- + +CREATE TABLE VIPR_CONFIGURATION ( + seq int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + serial_number varchar(255) DEFAULT NULL, + vnf_id varchar(255) DEFAULT NULL, + vnf_name varchar(255) DEFAULT NULL, + ecomp_service_instance_id varchar(255) DEFAULT NULL, + vm_name varchar(255) DEFAULT NULL, + cloud_region_id varchar(255) DEFAULT NULL, + cloud_owner varchar(255) DEFAULT NULL, + PRIMARY KEY (seq) +) ; + +-- +-- Table structure for table VIPR_SZ_MANAGER_KEY +-- -CREATE TABLE `VIPR_SZ_MANAGER_KEY` ( - `vipr_sz_manager_ip_addr` varchar(40) NOT NULL, - `vipr_sz_manager_state` varchar(10) DEFAULT NULL, - `vipr_sz_manager_api_key` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vipr_sz_manager_ip_addr`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VIPR_SZ_MANAGER_KEY ( + vipr_sz_manager_ip_addr varchar(40) NOT NULL, + vipr_sz_manager_state varchar(10) DEFAULT NULL, + vipr_sz_manager_api_key varchar(255) DEFAULT NULL, + PRIMARY KEY (vipr_sz_manager_ip_addr) +) ; -- --- Table structure for table `VLAN_ID_POOL` +-- Table structure for table VLAN_ID_POOL -- -CREATE TABLE `VLAN_ID_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `purpose` varchar(40) NOT NULL, - `status` varchar(40) NOT NULL, - `vlan_id` int(4) NOT NULL, - `svc_instance_id` varchar(80) DEFAULT NULL, - `availability_zone` varchar(100) DEFAULT NULL, - `vplspe_name` varchar(80) DEFAULT NULL, - PRIMARY KEY (`vlan_id`,`aic_site_id`,`purpose`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_ID_POOL ( + aic_site_id varchar(100) NOT NULL, + purpose varchar(40) NOT NULL, + status varchar(40) NOT NULL, + vlan_id int NOT NULL, + svc_instance_id varchar(80) DEFAULT NULL, + availability_zone varchar(100) DEFAULT NULL, + vplspe_name varchar(80) DEFAULT NULL, + PRIMARY KEY (vlan_id,aic_site_id,purpose) +) ; -- --- Table structure for table `VLAN_L3INTERFACE_IPV4_ADDRESS` +-- Table structure for table VLAN_L3INTERFACE_IPV4_ADDRESS -- -CREATE TABLE `VLAN_L3INTERFACE_IPV4_ADDRESS` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `l3_interface_ipv4_address` varchar(64) NOT NULL, - `l3_interface_ipv4_prefix_length` varchar(45) DEFAULT NULL, - `vlan_id_inner` varchar(45) DEFAULT NULL, - `vlan_id_outer` varchar(45) DEFAULT NULL, - `is_floating` varchar(1) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`,`l3_interface_ipv4_address`), - KEY `FK_VLAN_L3INTERFACE_IPV4_ADDRESS_LINTERFACE_VLAN_IDX` (`vnf_id`,`interface_name`), - CONSTRAINT `FK_VLAN_L3INTERFACE_IPV4_ADDRESS_LINTERFACE_VLAN` FOREIGN KEY (`vnf_id`, `interface_name`, `vlan_interface`) REFERENCES `LINTERFACE_VLAN` (`vnf_id`, `interface_name`, `vlan_interface`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_L3INTERFACE_IPV4_ADDRESS ( + vnf_id varchar(80) NOT NULL, + interface_name varchar(255) NOT NULL, + vlan_interface varchar(255) NOT NULL, + l3_interface_ipv4_address varchar(64) NOT NULL, + l3_interface_ipv4_prefix_length varchar(45) DEFAULT NULL, + vlan_id_inner varchar(45) DEFAULT NULL, + vlan_id_outer varchar(45) DEFAULT NULL, + is_floating varchar(1) DEFAULT NULL, + PRIMARY KEY (vnf_id,interface_name,vlan_interface,l3_interface_ipv4_address) +) ; -- --- Table structure for table `VLAN_L3INTERFACE_IPV6_ADDRESS` +-- Table structure for table VLAN_L3INTERFACE_IPV6_ADDRESS -- -CREATE TABLE `VLAN_L3INTERFACE_IPV6_ADDRESS` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `l3_interface_ipv6_address` varchar(64) NOT NULL, - `l3_interface_ipv6_prefix_length` varchar(45) DEFAULT NULL, - `vlan_id_inner` varchar(45) DEFAULT NULL, - `vlan_id_outer` varchar(45) DEFAULT NULL, - `is_floating` varchar(1) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`,`l3_interface_ipv6_address`), - KEY `FK_VLAN_L3INTERFACE_IPV6_ADDRESS_LINTERFACE_VLAN_IDX` (`vnf_id`,`interface_name`,`vlan_interface`), - CONSTRAINT `FK_VLAN_L3INTERFACE_IPV6_ADDRESS_LINTERFACE_VLAN` FOREIGN KEY (`vnf_id`, `interface_name`, `vlan_interface`) REFERENCES `LINTERFACE_VLAN` (`vnf_id`, `interface_name`, `vlan_interface`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_L3INTERFACE_IPV6_ADDRESS ( + vnf_id varchar(80) NOT NULL, + interface_name varchar(255) NOT NULL, + vlan_interface varchar(255) NOT NULL, + l3_interface_ipv6_address varchar(64) NOT NULL, + l3_interface_ipv6_prefix_length varchar(45) DEFAULT NULL, + vlan_id_inner varchar(45) DEFAULT NULL, + vlan_id_outer varchar(45) DEFAULT NULL, + is_floating varchar(1) DEFAULT NULL, + PRIMARY KEY (vnf_id,interface_name,vlan_interface,l3_interface_ipv6_address) +) ; -- --- Table structure for table `VLAN_PLAN_ID` +-- Table structure for table VLAN_PLAN_ID -- -CREATE TABLE `VLAN_PLAN_ID` ( - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `vlan_plan_id_count` int(4) NOT NULL, - PRIMARY KEY (`vlan_plan_id_count`,`plan_type`,`purpose`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_PLAN_ID ( + plan_type varchar(40) NOT NULL, + purpose varchar(40) NOT NULL, + vlan_plan_id_count int NOT NULL, + PRIMARY KEY (vlan_plan_id_count,plan_type,purpose) +) ; -- --- Table structure for table `VLAN_POOL` +-- Table structure for table VLAN_POOL -- -CREATE TABLE `VLAN_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `vlan_plan_id` varchar(100) NOT NULL, - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `vlan_id` int(4) NOT NULL, - `status` varchar(40) NOT NULL, - `reserved_id` varchar(80) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`vlan_plan_id`,`plan_type`,`purpose`,`vlan_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_POOL ( + aic_site_id varchar(100) NOT NULL, + availability_zone varchar(100) NOT NULL, + vlan_plan_id varchar(100) NOT NULL, + plan_type varchar(40) NOT NULL, + purpose varchar(40) NOT NULL, + vlan_id int NOT NULL, + status varchar(40) NOT NULL, + reserved_id varchar(80) DEFAULT NULL, + PRIMARY KEY (aic_site_id,availability_zone,vlan_plan_id,plan_type,purpose,vlan_id) +) ; -- --- Table structure for table `VLAN_RANGES` +-- Table structure for table VLAN_RANGES -- -CREATE TABLE `VLAN_RANGES` ( - `vlan_plan_id` varchar(100) NOT NULL, - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `range_start` int(4) NOT NULL, - `range_end` int(4) NOT NULL, - `generated` char(1) DEFAULT NULL, - PRIMARY KEY (`vlan_plan_id`,`plan_type`,`purpose`,`range_start`,`range_end`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VLAN_RANGES ( + vlan_plan_id varchar(100) NOT NULL, + plan_type varchar(40) NOT NULL, + purpose varchar(40) NOT NULL, + range_start int NOT NULL, + range_end int NOT NULL, + generated char(1) DEFAULT NULL, + PRIMARY KEY (vlan_plan_id,plan_type,purpose,range_start,range_end) +) ; -- --- Table structure for table `VM_NAME_INDEX` +-- Table structure for table VM_NAME_INDEX -- -CREATE TABLE `VM_NAME_INDEX` ( - `vm_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vm_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VM_NAME_INDEX ( + vm_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (vm_name_prefix) +) ; -- --- Table structure for table `VM_NETWORKS` +-- Table structure for table VM_NETWORKS -- -CREATE TABLE `VM_NETWORKS` ( - `vnf_type` varchar(200) NOT NULL, - `vm_type` varchar(45) NOT NULL, - `network_role` varchar(45) NOT NULL, - `assign_ips` tinyint(1) NOT NULL, - `assign_macs` tinyint(1) NOT NULL, - `assign_floating_ip` tinyint(1) NOT NULL, - `ip_count` int(11) DEFAULT NULL, - PRIMARY KEY (`vnf_type`,`vm_type`,`network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VM_NETWORKS ( + vnf_type varchar(200) NOT NULL, + vm_type varchar(45) NOT NULL, + network_role varchar(45) NOT NULL, + assign_ips smallint NOT NULL, + assign_macs smallint NOT NULL, + assign_floating_ip smallint NOT NULL, + ip_count int DEFAULT NULL, + PRIMARY KEY (vnf_type,vm_type,network_role) +) ; -- --- Table structure for table `VM_PROFILE` +-- Table structure for table VM_PROFILE -- -CREATE TABLE `VM_PROFILE` ( - `vnf_type` varchar(200) NOT NULL, - `vm_type` varchar(45) NOT NULL, - `vm_count` int(11) NOT NULL, - PRIMARY KEY (`vnf_type`,`vm_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VM_PROFILE ( + vnf_type varchar(200) NOT NULL, + vm_type varchar(45) NOT NULL, + vm_count int NOT NULL, + PRIMARY KEY (vnf_type,vm_type) +) ; -- --- Table structure for table `VNF` +-- Table structure for table VNF -- -CREATE TABLE `VNF` ( - `vnf_id` varchar(80) NOT NULL, - `vnf_name` varchar(80) NOT NULL, - `vnf_type` varchar(10) NOT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `availability_zone` varchar(80) DEFAULT NULL, - `aic_site_id` varchar(80) DEFAULT NULL, - `oam_ipv4_address` varchar(20) DEFAULT NULL, - `vnf_name2` varchar(80) DEFAULT NULL, - `vpe_id` varchar(80) NOT NULL, - `ipv4_loopback0_address` varchar(80) DEFAULT NULL, - `license_key` varchar(256) DEFAULT NULL, - `entitlement_resource_uuid` varchar(256) DEFAULT NULL, - PRIMARY KEY (`vnf_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF ( + vnf_id varchar(80) NOT NULL, + vnf_name varchar(80) NOT NULL, + vnf_type varchar(10) NOT NULL, + orchestration_status varchar(20) DEFAULT NULL, + heat_stack_id varchar(80) DEFAULT NULL, + mso_catalog_key varchar(80) DEFAULT NULL, + availability_zone varchar(80) DEFAULT NULL, + aic_site_id varchar(80) DEFAULT NULL, + oam_ipv4_address varchar(20) DEFAULT NULL, + vnf_name2 varchar(80) DEFAULT NULL, + vpe_id varchar(80) NOT NULL, + ipv4_loopback0_address varchar(80) DEFAULT NULL, + license_key varchar(256) DEFAULT NULL, + entitlement_resource_uuid varchar(256) DEFAULT NULL, + PRIMARY KEY (vnf_id) +) ; -- --- Table structure for table `VNFC_DG_MAPPING` +-- Table structure for table VNFC_DG_MAPPING -- -CREATE TABLE `VNFC_DG_MAPPING` ( - `vnfc_dg_mapping_id` int(11) NOT NULL AUTO_INCREMENT, - `action` varchar(50) DEFAULT NULL, - `api_version` varchar(10) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `dg_name` varchar(50) NOT NULL, - `dg_version` varchar(50) DEFAULT NULL, - `dg_module` varchar(50) NOT NULL, - PRIMARY KEY (`vnfc_dg_mapping_id`), - UNIQUE KEY `input_constraint` (`action`,`api_version`,`vnf_type`,`vnfc_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNFC_DG_MAPPING ( + vnfc_dg_mapping_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + action varchar(50) DEFAULT NULL, + api_version varchar(10) DEFAULT NULL, + vnf_type varchar(50) DEFAULT NULL, + vnfc_type varchar(50) DEFAULT NULL, + dg_name varchar(50) NOT NULL, + dg_version varchar(50) DEFAULT NULL, + dg_module varchar(50) NOT NULL, + PRIMARY KEY (vnfc_dg_mapping_id) +) ; -- --- Table structure for table `VNFC_REFERENCE` +-- Table structure for table VNFC_REFERENCE -- -CREATE TABLE `VNFC_REFERENCE` ( - `vnfc_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `action` varchar(50) NOT NULL, - `vnf_type` varchar(50) NOT NULL, - `vm_instance` int(11) NOT NULL, - `vnfc_instance` int(11) NOT NULL, - `vnfc_type` varchar(50) NOT NULL, - `vnfc_function_code` varchar(50) NOT NULL, - `ipaddress_v4_oam_vip` varchar(50) DEFAULT NULL, - `group_notation_type` varchar(50) DEFAULT NULL, - `group_notation_value` varchar(50) DEFAULT NULL, - PRIMARY KEY (`vnfc_reference_id`), - UNIQUE KEY `vnfc_reference_id` (`vnfc_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; +CREATE TABLE VNFC_REFERENCE ( + vnfc_reference_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + action varchar(50) NOT NULL, + vnf_type varchar(50) NOT NULL, + vm_instance int NOT NULL, + vnfc_instance int NOT NULL, + vnfc_type varchar(50) NOT NULL, + vnfc_function_code varchar(50) NOT NULL, + ipaddress_v4_oam_vip varchar(50) DEFAULT NULL, + group_notation_type varchar(50) DEFAULT NULL, + group_notation_value varchar(50) DEFAULT NULL, + PRIMARY KEY (vnfc_reference_id) +) ; -- --- Table structure for table `VNF_IMAGE` +-- Table structure for table VNF_IMAGE -- -CREATE TABLE `VNF_IMAGE` ( - `application_vendor` varchar(255) NOT NULL, - `application_version` varchar(255) NOT NULL, - `att_uuid` varchar(255) NOT NULL, - `application` varchar(255) DEFAULT NULL, - `selflink` varchar(255) DEFAULT NULL, - PRIMARY KEY (`application_vendor`,`application_version`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_IMAGE ( + application_vendor varchar(255) NOT NULL, + application_version varchar(255) NOT NULL, + att_uuid varchar(255) NOT NULL, + application varchar(255) DEFAULT NULL, + selflink varchar(255) DEFAULT NULL, + PRIMARY KEY (application_vendor,application_version,att_uuid) +) ; -- --- Table structure for table `VNF_MODEL_LICENSES` +-- Table structure for table VNF_MODEL_LICENSES -- -CREATE TABLE `VNF_MODEL_LICENSES` ( - `att_part_number` varchar(255) NOT NULL, - `license_assignment_group` varchar(255) NOT NULL, - `license_required` tinyint(1) DEFAULT NULL, - `entitlement_assignment_group` varchar(255) DEFAULT NULL, - `entitlement_required` tinyint(1) DEFAULT '0', - `feature_group_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`att_part_number`,`license_assignment_group`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_MODEL_LICENSES ( + att_part_number varchar(255) NOT NULL, + license_assignment_group varchar(255) NOT NULL, + license_required smallint DEFAULT NULL, + entitlement_assignment_group varchar(255) DEFAULT NULL, + entitlement_required smallint DEFAULT 0, + feature_group_uuid varchar(255) DEFAULT NULL, + PRIMARY KEY (att_part_number,license_assignment_group) +) ; -- --- Table structure for table `VNF_MODEL_LICENSE_FEATURES` +-- Table structure for table VNF_MODEL_LICENSE_FEATURES -- -CREATE TABLE `VNF_MODEL_LICENSE_FEATURES` ( - `att_part_number` varchar(255) NOT NULL, - `license_assignment_group` varchar(255) NOT NULL, - `feature` varchar(255) NOT NULL, - PRIMARY KEY (`att_part_number`,`license_assignment_group`,`feature`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_MODEL_LICENSE_FEATURES ( + att_part_number varchar(255) NOT NULL, + license_assignment_group varchar(255) NOT NULL, + feature varchar(255) NOT NULL, + PRIMARY KEY (att_part_number,license_assignment_group,feature) +) ; -- --- Table structure for table `VNF_NAME_INDEX` +-- Table structure for table VNF_NAME_INDEX -- -CREATE TABLE `VNF_NAME_INDEX` ( - `vnf_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnf_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_NAME_INDEX ( + vnf_name_prefix varchar(255) NOT NULL, + index_number int NOT NULL, + PRIMARY KEY (vnf_name_prefix) +) ; -- --- Table structure for table `VNF_NETWORKS` +-- Table structure for table VNF_NETWORKS -- -CREATE TABLE `VNF_NETWORKS` ( - `vnf_type` varchar(200) NOT NULL, - `network_role` varchar(45) NOT NULL, - PRIMARY KEY (`vnf_type`,`network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_NETWORKS ( + vnf_type varchar(200) NOT NULL, + network_role varchar(45) NOT NULL, + PRIMARY KEY (vnf_type,network_role) +) ; -- --- Table structure for table `VNF_NETWORK_CONNECTION` +-- Table structure for table VNF_NETWORK_CONNECTION -- -CREATE TABLE `VNF_NETWORK_CONNECTION` ( - `connection_uuid` varchar(80) NOT NULL, - `vnf_id` varchar(80) NOT NULL, - `connection_id` varchar(80) DEFAULT NULL, - `connection_type` varchar(20) DEFAULT NULL, - `neutron_network_id` varchar(80) DEFAULT NULL, - `neutron_network_name` varchar(80) DEFAULT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `switch_id` varchar(40) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `provider_network` varchar(80) DEFAULT NULL, - `port_group_id` varchar(80) DEFAULT NULL, - `port_group_name` varchar(80) DEFAULT NULL, - PRIMARY KEY (`connection_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_NETWORK_CONNECTION ( + connection_uuid varchar(80) NOT NULL, + vnf_id varchar(80) NOT NULL, + connection_id varchar(80) DEFAULT NULL, + connection_type varchar(20) DEFAULT NULL, + neutron_network_id varchar(80) DEFAULT NULL, + neutron_network_name varchar(80) DEFAULT NULL, + orchestration_status varchar(20) DEFAULT NULL, + switch_id varchar(40) DEFAULT NULL, + heat_stack_id varchar(80) DEFAULT NULL, + mso_catalog_key varchar(80) DEFAULT NULL, + provider_network varchar(80) DEFAULT NULL, + port_group_id varchar(80) DEFAULT NULL, + port_group_name varchar(80) DEFAULT NULL, + PRIMARY KEY (connection_uuid) +) ; -- --- Table structure for table `VNF_NETWORK_CONNECTION_VLAN` +-- Table structure for table VNF_NETWORK_CONNECTION_VLAN -- -CREATE TABLE `VNF_NETWORK_CONNECTION_VLAN` ( - `vlan_uuid` varchar(80) NOT NULL, - `vlan_id` int(4) NOT NULL, - `vlan_type` varchar(5) NOT NULL, - `connection_uuid` varchar(80) DEFAULT NULL, - PRIMARY KEY (`vlan_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_NETWORK_CONNECTION_VLAN ( + vlan_uuid varchar(80) NOT NULL, + vlan_id int NOT NULL, + vlan_type varchar(5) NOT NULL, + connection_uuid varchar(80) DEFAULT NULL, + PRIMARY KEY (vlan_uuid) +) ; -- --- Table structure for table `VNF_PROFILE` +-- Table structure for table VNF_PROFILE -- -CREATE TABLE `VNF_PROFILE` ( - `vnf_type` varchar(200) NOT NULL, - `availability_zone_count` int(11) NOT NULL, - `equipment_role` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_PROFILE ( + vnf_type varchar(200) NOT NULL, + availability_zone_count int NOT NULL, + equipment_role varchar(80) NOT NULL, + PRIMARY KEY (vnf_type) +) ; -- --- Table structure for table `VNF_SERVICE_TO_NETWORK_ROLE_FILTER` +-- Table structure for table VNF_SERVICE_TO_NETWORK_ROLE_FILTER -- -CREATE TABLE `VNF_SERVICE_TO_NETWORK_ROLE_FILTER` ( - `vnf_service_type` varchar(60) NOT NULL, - `network_role_filter` varchar(60) NOT NULL, - PRIMARY KEY (`vnf_service_type`,`network_role_filter`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VNF_SERVICE_TO_NETWORK_ROLE_FILTER ( + vnf_service_type varchar(60) NOT NULL, + network_role_filter varchar(60) NOT NULL, + PRIMARY KEY (vnf_service_type,network_role_filter) +) ; -- --- Table structure for table `VPE_LOCK` +-- Table structure for table VPE_LOCK -- -CREATE TABLE `VPE_LOCK` ( - `vpe_name` varchar(20) NOT NULL, - `vpn_lock` varchar(20) NOT NULL, - PRIMARY KEY (`vpe_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPE_LOCK ( + vpe_name varchar(20) NOT NULL, + vpn_lock varchar(20) NOT NULL, + PRIMARY KEY (vpe_name) +) ; -- --- Table structure for table `VPE_MAC_ADDRESS_POOL` +-- Table structure for table VPE_MAC_ADDRESS_POOL -- -CREATE TABLE `VPE_MAC_ADDRESS_POOL` ( - `id` int(11) NOT NULL, - `mac_address` varchar(50) NOT NULL, - `sw_name` varchar(30) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPE_MAC_ADDRESS_POOL ( + id int NOT NULL, + mac_address varchar(50) NOT NULL, + sw_name varchar(30) NOT NULL, + PRIMARY KEY (id) +) ; -- --- Table structure for table `VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING` +-- Table structure for table VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING -- -CREATE TABLE `VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING` ( - `id` int(11) NOT NULL, - `hostname` varchar(50) NOT NULL, - `assigned_user` varchar(25) NOT NULL, - `assigned_date` date DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( + id int NOT NULL, + hostname varchar(50) NOT NULL, + assigned_user varchar(25) NOT NULL, + assigned_date date DEFAULT NULL, + PRIMARY KEY (id) +) ; -- --- Table structure for table `VPE_POOL` +-- Table structure for table VPE_POOL -- -CREATE TABLE `VPE_POOL` ( - `vpe_name` varchar(20) NOT NULL, - `ipv4_oam_address` varchar(20) NOT NULL, - `loopback0_ipv4_address` varchar(20) NOT NULL, - `provisioning_status` varchar(10) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `vlan_id_outer` varchar(20) NOT NULL, - `vendor` varchar(20) NOT NULL, - `physical_intf_name` varchar(40) NOT NULL, - `physical_intf_speed` varchar(20) NOT NULL, - `physical_intf_units` varchar(20) NOT NULL, - `vpe_uuid` varchar(80) DEFAULT NULL, - `vpe_id` varchar(80) NOT NULL, - `image_filename` varchar(100) DEFAULT NULL, - `as_number` varchar(20) NOT NULL, - `loopback5000` varchar(16) DEFAULT NULL, - `loopback10` varchar(16) DEFAULT NULL, - `aic_version` varchar(50) DEFAULT NULL, - `vpe_capacity` int(11) NOT NULL, - PRIMARY KEY (`aic_site_id`,`vpe_name`,`availability_zone`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPE_POOL ( + vpe_name varchar(20) NOT NULL, + ipv4_oam_address varchar(20) NOT NULL, + loopback0_ipv4_address varchar(20) NOT NULL, + provisioning_status varchar(10) NOT NULL, + aic_site_id varchar(100) NOT NULL, + availability_zone varchar(100) NOT NULL, + vlan_id_outer varchar(20) NOT NULL, + vendor varchar(20) NOT NULL, + physical_intf_name varchar(40) NOT NULL, + physical_intf_speed varchar(20) NOT NULL, + physical_intf_units varchar(20) NOT NULL, + vpe_uuid varchar(80) DEFAULT NULL, + vpe_id varchar(80) NOT NULL, + image_filename varchar(100) DEFAULT NULL, + as_number varchar(20) NOT NULL, + loopback5000 varchar(16) DEFAULT NULL, + loopback10 varchar(16) DEFAULT NULL, + aic_version varchar(50) DEFAULT NULL, + vpe_capacity int NOT NULL, + PRIMARY KEY (aic_site_id,vpe_name,availability_zone) +) ; -- --- Table structure for table `VPLSPE_POOL` +-- Table structure for table VPLSPE_POOL -- -CREATE TABLE `VPLSPE_POOL` ( - `vplspe_name` varchar(20) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `physical_intf_name` varchar(40) NOT NULL, - `physical_intf_speed` varchar(20) NOT NULL, - `physical_intf_units` varchar(20) NOT NULL, - `loopback0_ipv4_address` varchar(20) NOT NULL, - `vlan_id_outer` varchar(20) NOT NULL, - `vplspe_uuid` varchar(80) DEFAULT NULL, - `image_filename` varchar(100) DEFAULT NULL, - `provisioning_status` varchar(10) DEFAULT NULL, - `vendor` varchar(20) DEFAULT NULL, - PRIMARY KEY (`vplspe_name`,`aic_site_id`,`availability_zone`,`physical_intf_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPLSPE_POOL ( + vplspe_name varchar(20) NOT NULL, + aic_site_id varchar(100) NOT NULL, + availability_zone varchar(100) NOT NULL, + physical_intf_name varchar(40) NOT NULL, + physical_intf_speed varchar(20) NOT NULL, + physical_intf_units varchar(20) NOT NULL, + loopback0_ipv4_address varchar(20) NOT NULL, + vlan_id_outer varchar(20) NOT NULL, + vplspe_uuid varchar(80) DEFAULT NULL, + image_filename varchar(100) DEFAULT NULL, + provisioning_status varchar(10) DEFAULT NULL, + vendor varchar(20) DEFAULT NULL, + PRIMARY KEY (vplspe_name,aic_site_id,availability_zone,physical_intf_name) +) ; -- --- Table structure for table `VPN_BINDINGS` +-- Table structure for table VPN_BINDINGS -- -CREATE TABLE `VPN_BINDINGS` ( - `network_customization_uuid` varchar(255) NOT NULL, - `binding_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`network_customization_uuid`,`binding_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VPN_BINDINGS ( + network_customization_uuid varchar(255) NOT NULL, + binding_uuid varchar(255) NOT NULL, + PRIMARY KEY (network_customization_uuid,binding_uuid) +) ; -- --- Table structure for table `VRR_FUNCTION_CODE_VMTYPE_MAPPING` +-- Table structure for table VRR_FUNCTION_CODE_VMTYPE_MAPPING -- -CREATE TABLE `VRR_FUNCTION_CODE_VMTYPE_MAPPING` ( - `ptnii_function_code` varchar(128) NOT NULL, - `vm_type` varchar(128) NOT NULL, - PRIMARY KEY (`ptnii_function_code`,`vm_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VRR_FUNCTION_CODE_VMTYPE_MAPPING ( + ptnii_function_code varchar(128) NOT NULL, + vm_type varchar(128) NOT NULL, + PRIMARY KEY (ptnii_function_code,vm_type) +) ; -- --- Table structure for table `VSERVER` +-- Table structure for table VSERVER -- -CREATE TABLE `VSERVER` ( - `tenant_id` varchar(40) NOT NULL, - `vserver_id` varchar(40) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `vendor` varchar(20) NOT NULL, - `image_name` varchar(100) NOT NULL, - `vnf_type` varchar(10) NOT NULL, - `vnf_id` varchar(80) NOT NULL, - PRIMARY KEY (`tenant_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VSERVER2` --- - -CREATE TABLE `VSERVER2` ( - `tenant_id` varchar(255) NOT NULL, - `vserver_id` varchar(128) NOT NULL, - `vserver_name` varchar(255) NOT NULL, - `vserver_name2` varchar(255) DEFAULT NULL, - `prov_status` varchar(20) DEFAULT NULL, - `selflink` varchar(255) DEFAULT NULL, - PRIMARY KEY (`tenant_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VSERVER_PSERVER` --- - -CREATE TABLE `VSERVER_PSERVER` ( - `vserver_id` varchar(128) NOT NULL, - `pserver_hostname` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING` --- - -CREATE TABLE `VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING` ( - `key_id` varchar(128) NOT NULL, - `cloud_region` varchar(128) NOT NULL, - `key_type` varchar(128) NOT NULL, - PRIMARY KEY (`key_id`,`cloud_region`,`key_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `WAN_COMBO_ALLOWABLE` --- - -CREATE TABLE `WAN_COMBO_ALLOWABLE` ( - `combo_sequence` int(11) NOT NULL AUTO_INCREMENT, - `topology` varchar(16) DEFAULT 'unknown', - `internet_topology` varchar(20) DEFAULT NULL, - `wan1` varchar(40) DEFAULT NULL, - `wan2` varchar(40) DEFAULT NULL, - `new_start_release_flexware` varchar(16) DEFAULT 'unknown', - `is_active_flexware` varchar(1) DEFAULT 'N', - `new_start_release_dhv` varchar(16) DEFAULT 'unknown', - `is_active_dhv` varchar(1) DEFAULT 'N', - `ucpe_type` varchar(32) DEFAULT 'stand-alone', - `description` varchar(128) NOT NULL, - PRIMARY KEY (`combo_sequence`), - UNIQUE KEY `IX1_WAN_COMBO_ALLOWABLE` (`internet_topology`,`wan1`,`wan2`) -) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=latin1; - -CREATE TABLE `DHCP_MAP` ( - `mac_addr` varchar(128) NOT NULL, - `ip_addr` varchar(128) DEFAULT NULL, - PRIMARY KEY (`mac_addr`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `RESOURCE_GROUP_TO_TARGET_NODE_MAPPING` ( - `group_uuid` varchar(255) NOT NULL, - `parent_uuid` varchar(255) NOT NULL, - `target_node_uuid` varchar(255) NOT NULL, - `target_type` varchar(255) NULL, - `table_name` varchar(255) NULL, - PRIMARY KEY (`group_uuid`, `parent_uuid`, `target_node_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - - -CREATE TABLE `ATTRIBUTE_VALUE_PAIR` ( - `resource_uuid` varchar(255) NOT NULL, - `attribute_name` varchar(255) NOT NULL, - `resource_type` varchar(255) NOT NULL, - `attribute_value` varchar(255) DEFAULT NULL, - `resource_customization_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`attribute_name`,`resource_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `COMPLEX_RESOURCE` ( - `uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) NOT NULL, - `customization_uuid` varchar(255) NOT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `type` varchar(255) NOT NULL, - PRIMARY KEY (`uuid`,`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `NODE_CAPABILITY` ( - `capability_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_provider_uuid` varchar(255) NOT NULL, - `capability_provider_customization_uuid` varchar(255) NOT NULL, - `capability_name` varchar(255) DEFAULT NULL, - `capability_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`capability_id`) -) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=latin1; - -CREATE TABLE `NODE_REQUIREMENT` ( - `requirement_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_id` int(11) DEFAULT NULL, - `capability_provider_uuid` varchar(255) DEFAULT NULL, - `capability_provider_customization_uuid` varchar(255) DEFAULT NULL, - `capability_consumer_uuid` varchar(255) NOT NULL, - `capability_consumer_customization_uuid` varchar(255) NOT NULL, - `requirement_name` varchar(255) NOT NULL, - PRIMARY KEY (`requirement_id`), - KEY `NODE_REQUIREMENT_TO_NODE_CAPABILITY` (`capability_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - -CREATE TABLE `RELATED_NETWORK_ROLE` ( - `network_model_customization_uuid` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`network_model_customization_uuid`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `RESOURCE_GROUP` ( - `resource_uuid` varchar(255) NOT NULL, - `group_uuid` varchar(255) NOT NULL, - `group_customization_uuid` varchar(255) DEFAULT NULL, - `group_invariant_uuid` varchar(255) NOT NULL, - `group_name` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `group_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`group_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `RESOURCE_POLICY` ( - `resource_uuid` varchar(255) NOT NULL, - `policy_uuid` varchar(255) NOT NULL, - `policy_customization_uuid` varchar(255) DEFAULT NULL, - `policy_invariant_uuid` varchar(255) NOT NULL, - `policy_name` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `policy_type` varchar(255) DEFAULT NULL, - `property_type` varchar(255) DEFAULT NULL, - `property_source` varchar(255) DEFAULT NULL, - `property_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`policy_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `RESOURCE_POLICY_TO_TARGET_NODE_MAPPING` ( - `policy_uuid` varchar(255) NOT NULL, - `parent_uuid` varchar(255) NOT NULL, - `target_node_uuid` varchar(255) NOT NULL, - `target_type` varchar(255) DEFAULT NULL, - `target_node_customization_uuid` varchar(255) DEFAULT NULL, - `policy_customization_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`policy_uuid`,`parent_uuid`,`target_node_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - -CREATE TABLE `SERVICE_MODEL_TO_COMPLEX_RESOURCE_MAPPING` ( - `service_uuid` varchar(255) NOT NULL, - `complex_resource_uuid` varchar(255) NOT NULL, - `complex_resource_customization_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`service_uuid`,`complex_resource_uuid`,`complex_resource_customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `VFC_RELATED_NETWORK_ROLE` ( - `vfc_customization_uuid` varchar(255) NOT NULL, - `vm_type` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`vfc_customization_uuid`,`vm_type`,`network_role`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE `VNF_RELATED_NETWORK_ROLE` ( - `vnf_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_customization_uuid`,`network_role`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE VSERVER ( + tenant_id varchar(40) NOT NULL, + vserver_id varchar(40) NOT NULL, + aic_site_id varchar(100) NOT NULL, + vendor varchar(20) NOT NULL, + image_name varchar(100) NOT NULL, + vnf_type varchar(10) NOT NULL, + vnf_id varchar(80) NOT NULL, + PRIMARY KEY (tenant_id,vserver_id) +) ; + +-- +-- Table structure for table VSERVER2 +-- + +CREATE TABLE VSERVER2 ( + tenant_id varchar(255) NOT NULL, + vserver_id varchar(128) NOT NULL, + vserver_name varchar(255) NOT NULL, + vserver_name2 varchar(255) DEFAULT NULL, + prov_status varchar(20) DEFAULT NULL, + selflink varchar(255) DEFAULT NULL, + PRIMARY KEY (tenant_id,vserver_id) +) ; + +-- +-- Table structure for table VSERVER_PSERVER +-- + +CREATE TABLE VSERVER_PSERVER ( + vserver_id varchar(128) NOT NULL, + pserver_hostname varchar(255) DEFAULT NULL, + PRIMARY KEY (vserver_id) +) ; + +-- +-- Table structure for table VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING +-- + +CREATE TABLE VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING ( + key_id varchar(128) NOT NULL, + cloud_region varchar(128) NOT NULL, + key_type varchar(128) NOT NULL, + PRIMARY KEY (key_id,cloud_region,key_type) +) ; + +-- +-- Table structure for table WAN_COMBO_ALLOWABLE +-- + +CREATE TABLE WAN_COMBO_ALLOWABLE ( + combo_sequence int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + topology varchar(16) DEFAULT 'unknown', + internet_topology varchar(20) DEFAULT NULL, + wan1 varchar(40) DEFAULT NULL, + wan2 varchar(40) DEFAULT NULL, + new_start_release_flexware varchar(16) DEFAULT 'unknown', + is_active_flexware varchar(1) DEFAULT 'N', + new_start_release_dhv varchar(16) DEFAULT 'unknown', + is_active_dhv varchar(1) DEFAULT 'N', + ucpe_type varchar(32) DEFAULT 'stand-alone', + description varchar(128) NOT NULL, + PRIMARY KEY (combo_sequence) +) ; + +CREATE TABLE DHCP_MAP ( + mac_addr varchar(128) NOT NULL, + ip_addr varchar(128) DEFAULT NULL, + PRIMARY KEY (mac_addr) +) ; + +CREATE TABLE RESOURCE_GROUP_TO_TARGET_NODE_MAPPING ( + group_uuid varchar(255) NOT NULL, + parent_uuid varchar(255) NOT NULL, + target_node_uuid varchar(255) NOT NULL, + target_type varchar(255) , + table_name varchar(255) , + PRIMARY KEY (group_uuid, parent_uuid, target_node_uuid) +) ; + + + +CREATE TABLE ATTRIBUTE_VALUE_PAIR ( + resource_uuid varchar(255) NOT NULL, + attribute_name varchar(255) NOT NULL, + resource_type varchar(255) NOT NULL, + attribute_value varchar(255) DEFAULT NULL, + resource_customization_uuid varchar(255) DEFAULT NULL, + PRIMARY KEY (resource_uuid,attribute_name,resource_type) +) ; + +CREATE TABLE COMPLEX_RESOURCE ( + uuid varchar(255) NOT NULL, + model_yaml blob, + invariant_uuid varchar(255) NOT NULL, + customization_uuid varchar(255) NOT NULL, + version varchar(255) DEFAULT NULL, + name varchar(255) DEFAULT NULL, + description varchar(255) DEFAULT NULL, + type varchar(255) NOT NULL, + PRIMARY KEY (uuid,customization_uuid) +) ; + +CREATE TABLE NODE_CAPABILITY ( + capability_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + capability_provider_uuid varchar(255) NOT NULL, + capability_provider_customization_uuid varchar(255) NOT NULL, + capability_name varchar(255) DEFAULT NULL, + capability_type varchar(255) DEFAULT NULL, + PRIMARY KEY (capability_id) +) ; + +CREATE TABLE NODE_REQUIREMENT ( + requirement_id int NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1), + capability_id int DEFAULT NULL, + capability_provider_uuid varchar(255) DEFAULT NULL, + capability_provider_customization_uuid varchar(255) DEFAULT NULL, + capability_consumer_uuid varchar(255) NOT NULL, + capability_consumer_customization_uuid varchar(255) NOT NULL, + requirement_name varchar(255) NOT NULL, + PRIMARY KEY (requirement_id) +) ; + +CREATE TABLE RELATED_NETWORK_ROLE ( + network_model_customization_uuid varchar(255) NOT NULL, + related_network_role varchar(255) NOT NULL, + PRIMARY KEY (network_model_customization_uuid,related_network_role) +) ; + +CREATE TABLE RESOURCE_GROUP ( + resource_uuid varchar(255) NOT NULL, + group_uuid varchar(255) NOT NULL, + group_customization_uuid varchar(255) DEFAULT NULL, + group_invariant_uuid varchar(255) NOT NULL, + group_name varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + group_type varchar(255) DEFAULT NULL, + PRIMARY KEY (resource_uuid,group_uuid) +) ; + +CREATE TABLE RESOURCE_POLICY ( + resource_uuid varchar(255) NOT NULL, + policy_uuid varchar(255) NOT NULL, + policy_customization_uuid varchar(255) DEFAULT NULL, + policy_invariant_uuid varchar(255) NOT NULL, + policy_name varchar(255) DEFAULT NULL, + version varchar(255) DEFAULT NULL, + policy_type varchar(255) DEFAULT NULL, + property_type varchar(255) DEFAULT NULL, + property_source varchar(255) DEFAULT NULL, + property_name varchar(255) DEFAULT NULL, + PRIMARY KEY (resource_uuid,policy_uuid) +) ; + +CREATE TABLE RESOURCE_POLICY_TO_TARGET_NODE_MAPPING ( + policy_uuid varchar(255) NOT NULL, + parent_uuid varchar(255) NOT NULL, + target_node_uuid varchar(255) NOT NULL, + target_type varchar(255) DEFAULT NULL, + target_node_customization_uuid varchar(255) DEFAULT NULL, + policy_customization_uuid varchar(255) DEFAULT NULL, + PRIMARY KEY (policy_uuid,parent_uuid,target_node_uuid) +) ; + + +CREATE TABLE SERVICE_MODEL_TO_COMPLEX_RESOURCE_MAPPING ( + service_uuid varchar(255) NOT NULL, + complex_resource_uuid varchar(255) NOT NULL, + complex_resource_customization_uuid varchar(255) NOT NULL, + PRIMARY KEY (service_uuid,complex_resource_uuid,complex_resource_customization_uuid) +) ; + +CREATE TABLE VFC_RELATED_NETWORK_ROLE ( + vfc_customization_uuid varchar(255) NOT NULL, + vm_type varchar(255) NOT NULL, + network_role varchar(255) NOT NULL, + related_network_role varchar(255) NOT NULL, + PRIMARY KEY (vfc_customization_uuid,vm_type,network_role,related_network_role) +) ; + +CREATE TABLE VNF_RELATED_NETWORK_ROLE ( + vnf_customization_uuid varchar(255) NOT NULL, + network_role varchar(255) NOT NULL, + related_network_role varchar(255) NOT NULL, + PRIMARY KEY (vnf_customization_uuid,network_role,related_network_role) +) ; diff --git a/ms/generic-resource-api/src/main/resources/schema-mysql.sql b/ms/generic-resource-api/src/main/resources/schema-mysql.sql deleted file mode 100644 index a1a8b5a..0000000 --- a/ms/generic-resource-api/src/main/resources/schema-mysql.sql +++ /dev/null @@ -1,2764 +0,0 @@ - - --- --- Table structure for table `ACCESS_LOG` --- - -CREATE TABLE IF NOT EXISTS `ACCESS_LOG` ( - `access_log_seq` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `method` varchar(12) DEFAULT NULL, - `version` varchar(12) DEFAULT NULL, - `status` varchar(12) DEFAULT NULL, - `url` varchar(256) DEFAULT NULL, - `remote_address` varchar(128) DEFAULT NULL, - PRIMARY KEY (`access_log_seq`) -) ENGINE=InnoDB AUTO_INCREMENT=1034 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CUSTOMER` --- - - -CREATE TABLE IF NOT EXISTS `CUSTOMER` ( - `cust_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_name` varchar(256) DEFAULT NULL, - `grua` varchar(4) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`cust_id`), - UNIQUE KEY `IU1_CUSTOMER` (`customer_name`) -) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `ADDRESS_PLAN_POLICIES` --- - -CREATE TABLE IF NOT EXISTS `ADDRESS_PLAN_POLICIES` ( - `key_name` varchar(255) NOT NULL, - `key_value_source_type` varchar(255) NOT NULL, - `key_value_source` varchar(255) NOT NULL, - PRIMARY KEY (`key_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AGNOSTIC_NOTIFICATION_URL` --- - -CREATE TABLE IF NOT EXISTS `AGNOSTIC_NOTIFICATION_URL` ( - `service_type` varchar(128) NOT NULL, - `service_instance_id` varchar(128) NOT NULL, - `request_id` varchar(128) NOT NULL, - `svc_notification_url` varchar(256) NOT NULL, - PRIMARY KEY (`service_type`,`service_instance_id`,`request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `AGNOSTIC_TO_SVC_SPCFC_API` --- -CREATE TABLE IF NOT EXISTS `AGNOSTIC_TO_SVC_SPCFC_API` ( - `operation` varchar(128) NOT NULL, - `service` varchar(128) NOT NULL, - `service_specific_api` varchar(128) NOT NULL, - `async_process` varchar(15) DEFAULT NULL, - PRIMARY KEY (`operation`,`service`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_AVAIL_ZONE_POOL` --- -CREATE TABLE IF NOT EXISTS `AIC_AVAIL_ZONE_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `status` varchar(40) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `token` varchar(5) NOT NULL, - `vnf_id` varchar(80) DEFAULT NULL, - `service_type` varchar(100) NOT NULL, - `vnf_type` varchar(20) DEFAULT NULL, - `hypervisor` varchar(10) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_HOSTNAME` --- -CREATE TABLE IF NOT EXISTS `AIC_HOSTNAME` ( - `hostname` varchar(20) NOT NULL, - `cust_id` int(11) NOT NULL, - `vendor_code` varchar(1) NOT NULL, - `virtual_device_type` varchar(2) DEFAULT NULL, - `device_sequence` varchar(3) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`hostname`), - UNIQUE KEY `hostname` (`hostname`), - KEY `IN1_AIC_HOSTNAME` (`cust_id`), - CONSTRAINT `AC1_HOSTNAME` FOREIGN KEY (`cust_id`) REFERENCES `CUSTOMER` (`cust_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_NETWORK` --- - -CREATE TABLE IF NOT EXISTS `AIC_NETWORK` ( - `network_id` varchar(100) NOT NULL, - `network_name` varchar(100) DEFAULT NULL, - `status` varchar(20) DEFAULT NULL, - `tenant_id` varchar(100) DEFAULT NULL, - `switch_uuid` varchar(100) DEFAULT NULL, - `portgroup_name` varchar(100) DEFAULT NULL, - `portgroup_id` varchar(100) DEFAULT NULL, - PRIMARY KEY (`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_SITE` --- - -CREATE TABLE IF NOT EXISTS `AIC_SITE` ( - `name` varchar(100) DEFAULT NULL, - `aic_site_id` varchar(100) NOT NULL, - `vcenter_url` varchar(200) DEFAULT NULL, - `vcenter_username` varchar(40) DEFAULT NULL, - `vcenter_passwd` varbinary(255) DEFAULT NULL, - `city` varchar(100) DEFAULT NULL, - `state` varchar(2) DEFAULT NULL, - `operational_status` varchar(20) DEFAULT NULL, - `oam_gateway_addr` varchar(20) DEFAULT '', - PRIMARY KEY (`aic_site_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_SWITCH` --- - -CREATE TABLE IF NOT EXISTS `AIC_SWITCH` ( - `switch_name` varchar(100) DEFAULT NULL, - `physical_network_name` varchar(100) NOT NULL, - `aic_site_id` varchar(100) DEFAULT NULL, - `uuid` varchar(100) DEFAULT NULL, - `availability_zone` varchar(100) DEFAULT NULL, - PRIMARY KEY (`physical_network_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `AIC_ZONE_CLOUD_REGION_ID` --- - -CREATE TABLE IF NOT EXISTS `AIC_ZONE_CLOUD_REGION_ID` ( - `zone_region_id` varchar(255) NOT NULL, - `cilli_code` varchar(255) NOT NULL, - `location_id` varchar(255) NOT NULL DEFAULT '', - `city_state_country` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`zone_region_id`,`cilli_code`,`location_id`,`city_state_country`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `ALLOCATION_ITEM` --- - -CREATE TABLE IF NOT EXISTS `ALLOCATION_ITEM` ( - `allocation_item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_id` bigint(20) NOT NULL, - `application_id` varchar(50) NOT NULL, - `resource_set_id` varchar(200) NOT NULL, - `resource_union_id` varchar(200) NOT NULL, - `resource_share_group_list` varchar(200) DEFAULT NULL, - `lt_used` bigint(20) DEFAULT NULL, - `ll_label` varchar(50) DEFAULT NULL, - `rr_used` varchar(200) DEFAULT NULL, - `allocation_time` datetime NOT NULL, - PRIMARY KEY (`allocation_item_id`), - UNIQUE KEY `allocation_item_id` (`allocation_item_id`), - UNIQUE KEY `IX2_ALLOCATION_ITEM` (`resource_id`,`resource_set_id`), - KEY `IX1_ALLOCATION_ITEM` (`resource_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5764 DEFAULT CHARSET=latin1; - --- --- Table structure for table `ALLOTTED_RESOURCE_MODEL` --- - -CREATE TABLE IF NOT EXISTS `ALLOTTED_RESOURCE_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `depending_service` varchar(255) DEFAULT NULL, - `role` varchar(255) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `service_dependency` varchar(255) DEFAULT NULL, - `allotted_resource_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `ALTS_CREDENTIALS` --- - -CREATE TABLE IF NOT EXISTS `ALTS_CREDENTIALS` ( - `alts_username` varchar(255) NOT NULL, - `alts_password` varbinary(255) NOT NULL, - PRIMARY KEY (`alts_username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `ASDC_ARTIFACTS` --- - -CREATE TABLE IF NOT EXISTS `ASDC_ARTIFACTS` ( - `asdc_artifacts_id` int(11) NOT NULL AUTO_INCREMENT, - `service_uuid` varchar(50) DEFAULT NULL, - `distribution_id` varchar(50) DEFAULT NULL, - `service_name` varchar(255) DEFAULT NULL, - `service_description` varchar(255) DEFAULT NULL, - `resource_uuid` varchar(255) DEFAULT NULL, - `resource_instance_name` varchar(255) DEFAULT NULL, - `resource_name` varchar(255) DEFAULT NULL, - `resource_version` varchar(50) DEFAULT NULL, - `resource_type` varchar(50) DEFAULT NULL, - `artifact_uuid` varchar(50) DEFAULT NULL, - `artifact_type` varchar(50) DEFAULT NULL, - `artifact_version` varchar(25) DEFAULT NULL, - `artifact_description` varchar(255) DEFAULT NULL, - `internal_version` int(11) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `artifact_name` varchar(255) DEFAULT NULL, - `artifact_content` longtext, - PRIMARY KEY (`asdc_artifacts_id`), - UNIQUE KEY `asdc_artifacts_id` (`asdc_artifacts_id`) -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; - --- --- Table structure for table `ASDC_REFERENCE` --- - -CREATE TABLE IF NOT EXISTS `ASDC_REFERENCE` ( - `asdc_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `service_type` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `file_category` varchar(50) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `artifact_type` varchar(50) DEFAULT NULL, - `artifact_name` varchar(255) NOT NULL, - PRIMARY KEY (`asdc_reference_id`), - UNIQUE KEY `asdc_reference_id` (`asdc_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `BLOB_TEST` --- - -CREATE TABLE IF NOT EXISTS `BLOB_TEST` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `odl` varchar(20) DEFAULT NULL, - `communities` mediumblob, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `retry_count` int(11) DEFAULT '-1', - PRIMARY KEY (`seq`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `CAPABILITY` --- - -CREATE TABLE IF NOT EXISTS `CAPABILITY` ( - `capability_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_name` varchar(50) NOT NULL, - `implementation_name` varchar(100) NOT NULL, - `operation_name` varchar(50) NOT NULL, - `operation_description` varchar(100) NOT NULL, - `input_definition` longtext, - `output_definition` longtext, - `dependency_definition` longtext, - `tags` varchar(100) DEFAULT NULL, - PRIMARY KEY (`capability_id`), - UNIQUE KEY `capability_id` (`capability_name`) -) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CITY_CODE` --- - -CREATE TABLE IF NOT EXISTS `CITY_CODE` ( - `city_code_id` int(11) NOT NULL AUTO_INCREMENT, - `city_code` varchar(3) NOT NULL, - `city` varchar(150) NOT NULL, - `state` varchar(10) NOT NULL, - `country_code` varchar(10) NOT NULL, - PRIMARY KEY (`city_code_id`), - KEY `IN1_CITY_CODE` (`city`,`state`,`country_code`) -) ENGINE=InnoDB AUTO_INCREMENT=37822 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CLI_UPDATES` --- - -CREATE TABLE IF NOT EXISTS `CLI_UPDATES` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `create_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `last_processed_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `target_address` varchar(128) DEFAULT NULL, - `cli_text` varchar(128) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `CONFIGFILES` --- - -CREATE TABLE IF NOT EXISTS `CONFIGFILES` ( - `config_file_id` int(11) NOT NULL AUTO_INCREMENT, - `external_version` varchar(50) DEFAULT NULL, - `data_source` varchar(25) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `service_instance_id` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `file_category` varchar(50) DEFAULT NULL, - `file_name` varchar(255) DEFAULT NULL, - `file_content` longtext, - `action` varchar(50) DEFAULT NULL, - `vnf_id` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`config_file_id`), - UNIQUE KEY `config_file_id` (`config_file_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CONFIGURE_ACTION_DG` --- - - -CREATE TABLE IF NOT EXISTS `CONFIGURE_ACTION_DG` ( - `configure_action_dg_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `init_config_dg` varchar(50) DEFAULT NULL, - `generate_config_dg` varchar(50) DEFAULT NULL, - `download_config_dg` varchar(50) DEFAULT NULL, - PRIMARY KEY (`configure_action_dg_id`), - UNIQUE KEY `configure_action_dg_id` (`configure_action_dg_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `CONFIG_CONTENT` --- - -CREATE TABLE IF NOT EXISTS `CONFIG_CONTENT` ( - `config_content_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` varchar(50) NOT NULL, - `content_type` varchar(50) NOT NULL, - `template_name` varchar(50) DEFAULT NULL, - `originator_id` varchar(50) DEFAULT NULL, - `service_description` varchar(100) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `service_type` varchar(50) DEFAULT NULL, - `service_instance_id` varchar(50) DEFAULT NULL, - `vnf_id` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `host_ip_address` varchar(50) DEFAULT NULL, - `config_indicator` varchar(25) DEFAULT NULL, - `pending_delete` varchar(1) DEFAULT NULL, - `content` longtext, - PRIMARY KEY (`config_content_id`), - UNIQUE KEY `config_content_id` (`creation_date`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `CONFIG_FILE_REFERENCE` --- - -CREATE TABLE IF NOT EXISTS `CONFIG_FILE_REFERENCE` ( - `config_file_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `site_location` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `import_type` varchar(50) DEFAULT NULL, - `file_type` varchar(50) DEFAULT NULL, - `source_server_name` varchar(255) DEFAULT NULL, - `source_file_path` varchar(255) DEFAULT NULL, - `target_file_path` varchar(255) DEFAULT NULL, - `name` varchar(50) DEFAULT NULL, - `file_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`config_file_reference_id`), - UNIQUE KEY `config_file_reference_id` (`config_file_reference_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `CONFIG_TRANSACTION_LOG` --- - -CREATE TABLE IF NOT EXISTS `CONFIG_TRANSACTION_LOG` ( - `config_transaction_log_id` varchar(50) NOT NULL, - `request_id` varchar(50) DEFAULT NULL, - `message_type` varchar(100) DEFAULT NULL, - `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `message` longtext, - PRIMARY KEY (`config_transaction_log_id`), - UNIQUE KEY `config_transaction_log_id` (`config_transaction_log_id`) -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `COUNTRY_ASN_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `COUNTRY_ASN_MAPPING` ( - `asn` int(5) NOT NULL, - `iso_2char` varchar(5) NOT NULL, - `iso_3char` varchar(5) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - - - --- --- Table structure for table `CUSTOMER2CONNECTION_MAPPING` --- - -CREATE TABLE `CUSTOMER2CONNECTION_MAPPING` ( - `customer2connection_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `service_type` varchar(30) DEFAULT NULL, - `connection_id` varchar(100) NOT NULL, - `status` varchar(20) DEFAULT NULL, - PRIMARY KEY (`customer2connection_id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; - --- --- Table structure for table `CUSTOMER2CONNECTION_MAPPING_NEW` --- - -CREATE TABLE IF NOT EXISTS `CUSTOMER2CONNECTION_MAPPING_NEW` ( - `customer2connection_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `service_type` varchar(30) DEFAULT NULL, - `connection_id` varchar(100) NOT NULL, - `status` varchar(100) DEFAULT NULL, - PRIMARY KEY (`customer2connection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `DATA_OBJECT_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `DATA_OBJECT_MAPPING` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `data_object_key` varchar(100) NOT NULL, - `data_object_type` varchar(50) NOT NULL, - `service_type` varchar(50) NOT NULL, - `data_object_key2` varchar(100) NOT NULL, - `data_object_key2_type` varchar(50) NOT NULL, - `data_object_key3` varchar(100) DEFAULT NULL, - `data_object_key3_type` varchar(50) DEFAULT NULL, - `service` varchar(50) DEFAULT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DATA_OBJECT_MAPPING` (`data_object_key`,`data_object_type`,`service_type`), - KEY `IX2_DATA_OBJECT_MAPPING` (`service_type`,`data_object_key2`,`data_object_key2_type`) -) ENGINE=InnoDB AUTO_INCREMENT=3211 DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE2CONNECTION_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `DEVICE2CONNECTION_MAPPING` ( - `vnf_host_name` varchar(100) NOT NULL, - `e2e_vpn_key` varchar(30) NOT NULL, - `service_type` varchar(30) NOT NULL, - `connection_id` varchar(100) NOT NULL, - PRIMARY KEY (`vnf_host_name`,`e2e_vpn_key`,`service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE2IPADDRESS_CONSUMPTION` --- - -CREATE TABLE IF NOT EXISTS `DEVICE2IPADDRESS_CONSUMPTION` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `device_id` varchar(100) NOT NULL, - `device_type` varchar(30) NOT NULL, - `ip_version` varchar(10) NOT NULL, - `consumption_key` varchar(100) NOT NULL, - `logical_interface_service_id` varchar(100) NOT NULL, - `address_type` varchar(30) NOT NULL, - `ip_consumed` varchar(50) NOT NULL, - `vnf_type` varchar(30) NOT NULL, - `secondary_key` varchar(100) DEFAULT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DEVICEIPADDRESS_CONSUMPTION` (`device_id`,`device_type`,`ip_version`) -) ENGINE=InnoDB AUTO_INCREMENT=1357 DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE2IPADDRESS_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `DEVICE2IPADDRESS_MAPPING` ( - `serial_key` int(11) NOT NULL AUTO_INCREMENT, - `device_id` varchar(100) NOT NULL, - `device_type` varchar(30) NOT NULL, - `secondary_key` varchar(100) NOT NULL, - `secondary_key_type` varchar(30) NOT NULL, - `address` varchar(50) NOT NULL, - `address_type` varchar(30) NOT NULL, - `ip_version` varchar(10) NOT NULL, - `length` int(11) NOT NULL, - `status` varchar(30) NOT NULL, - PRIMARY KEY (`serial_key`), - KEY `IX1_DEVICE2IPADDRESS_MAPPING` (`device_id`,`device_type`,`secondary_key`,`secondary_key_type`,`address`,`address_type`) -) ENGINE=InnoDB AUTO_INCREMENT=4734 DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE_AUTHENTICATION` --- - -CREATE TABLE IF NOT EXISTS `DEVICE_AUTHENTICATION` ( - `device_authentication_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `user_name` varchar(50) DEFAULT NULL, - `password` varchar(100) DEFAULT NULL, - `protocol` varchar(100) DEFAULT NULL, - `port_number` int(11) DEFAULT NULL, - PRIMARY KEY (`device_authentication_id`), - UNIQUE KEY `device_authentication_id` (`device_authentication_id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE_INTERFACE_LOG` --- - -CREATE TABLE IF NOT EXISTS `DEVICE_INTERFACE_LOG` ( - `device_interface_log_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(50) DEFAULT NULL, - `request_id` varchar(50) DEFAULT NULL, - `creation_date` datetime NOT NULL, - `log` longtext, - PRIMARY KEY (`device_interface_log_id`), - UNIQUE KEY `device_interface_log_id` (`device_interface_log_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `DEVICE_INTERFACE_PROTOCOL` --- - -CREATE TABLE IF NOT EXISTS `DEVICE_INTERFACE_PROTOCOL` ( - `device_interface_protocol_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) DEFAULT NULL, - `protocol` varchar(50) DEFAULT NULL, - `module` varchar(50) DEFAULT NULL, - `dg_rpc` varchar(50) DEFAULT NULL, - PRIMARY KEY (`device_interface_protocol_id`), - UNIQUE KEY `device_interface_protocol_id` (`device_interface_protocol_id`), - UNIQUE KEY `vnf_type` (`vnf_type`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - --- --- Table structure for table `DOWNLOAD_CONFIG_TEMPLATE` --- - -CREATE TABLE IF NOT EXISTS `DOWNLOAD_CONFIG_TEMPLATE` ( - `download_config_template_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) NOT NULL, - `protocol` varchar(50) NOT NULL, - `template` longtext, - PRIMARY KEY (`download_config_template_id`), - UNIQUE KEY `download_config_template_id` (`download_config_template_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `DOWNLOAD_DG_REFERENCE` --- - -CREATE TABLE IF NOT EXISTS `DOWNLOAD_DG_REFERENCE` ( - `download_dg_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `protocol` varchar(50) NOT NULL, - `download_config_dg` varchar(50) NOT NULL, - PRIMARY KEY (`download_dg_reference_id`), - UNIQUE KEY `download_dg_reference_id` (`download_dg_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_CLIENT_KEY_INDEX` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_CLIENT_KEY_INDEX` ( - `vnf_name_prefix` varchar(100) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnf_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_IP_ASSIGNMENTS` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_IP_ASSIGNMENTS` ( - `plan_name` varchar(40) NOT NULL, - `client_key` varchar(100) NOT NULL, - `service_type` varchar(40) NOT NULL, - `ip_address` varchar(40) DEFAULT NULL, - `prefix_length` int(2) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `service_instance_id` varchar(80) DEFAULT NULL, - `last_modified_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `prev_status` varchar(20) DEFAULT NULL, - `info` varchar(255) DEFAULT NULL, - PRIMARY KEY (`plan_name`,`client_key`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_IP_POOLS` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_IP_POOLS` ( - `pool_id` int(11) NOT NULL AUTO_INCREMENT, - `key_name` varchar(50) NOT NULL, - `key_value` varchar(255) NOT NULL, - `level` int(2) NOT NULL, - `plan_name` varchar(50) NOT NULL, - `address_family` varchar(10) NOT NULL, - `parent_pool` varchar(255) NOT NULL, - `service_instance_id` varchar(255) DEFAULT NULL, - `network_id` varchar(255) DEFAULT NULL, - `created_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `delete_failure` varchar(20) DEFAULT NULL, - `delete_request_id` varchar(255) DEFAULT NULL, - PRIMARY KEY (`pool_id`) -) ENGINE=InnoDB AUTO_INCREMENT=339 DEFAULT CHARSET=latin1 COMMENT='This table will capture the pools being created by SDN-C in EIPAM_IP_POOLS. There is no data migration for existing vPE pool data.'; - --- --- Table structure for table `EIPAM_IP_SUBNETS` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_IP_SUBNETS` ( - `entity_id` int(6) NOT NULL, - `service_type` varchar(40) NOT NULL, - `plan_name` varchar(50) NOT NULL, - `address_family` varchar(10) NOT NULL, - `ip_address` varchar(40) NOT NULL, - `prefix_length` int(3) NOT NULL, - `status` varchar(20) NOT NULL, - `last_modified_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `network_id` varchar(255) DEFAULT NULL, - `pool_id` int(11) DEFAULT NULL, - `dealloc_failure` varchar(20) DEFAULT NULL, - `dealloc_request_id` varchar(255) DEFAULT NULL, - PRIMARY KEY (`entity_id`), - KEY `FK_EIPAM_IP_SUBNETS_EIPAM_IP_POOLS` (`pool_id`), - CONSTRAINT `EIPAM_IP_SUBNETS_ibfk_1` FOREIGN KEY (`pool_id`) REFERENCES `EIPAM_IP_POOLS` (`pool_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK_EIPAM_IP_SUBNETS_EIPAM_IP_POOLS` FOREIGN KEY (`pool_id`) REFERENCES `EIPAM_IP_POOLS` (`pool_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_IP_SUBNET_KEYS` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_IP_SUBNET_KEYS` ( - `entity_id` int(6) NOT NULL, - `key_name` varchar(50) NOT NULL, - `key_value` varchar(255) NOT NULL, - `level` int(2) NOT NULL, - PRIMARY KEY (`entity_id`,`key_name`,`key_value`,`level`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `EIPAM_REQUEST_KEY` --- - -CREATE TABLE IF NOT EXISTS `EIPAM_REQUEST_KEY` ( - `key_name_1` varchar(50) NOT NULL, - `address_family` varchar(4) NOT NULL, - `serial_key` int(2) NOT NULL AUTO_INCREMENT, - `plan_name` varchar(50) NOT NULL, - `request_length` int(2) NOT NULL, - `pools_length` int(2) NOT NULL, - `plan_length` int(2) NOT NULL, - `key_name_0` varchar(50) NOT NULL, - `key_name_type_0` varchar(255) NOT NULL, - `key_name_type_1` varchar(255) NOT NULL, - `prefix_length` int(2) NOT NULL, - `group_flag` char(1) NOT NULL, - `address_type` varchar(20) DEFAULT NULL, - PRIMARY KEY (`key_name_1`,`address_family`), - UNIQUE KEY `IX1_EIPAM_REQUEST_KEY` (`serial_key`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - --- --- Table structure for table `EXTERNAL_DATA` --- - -CREATE TABLE IF NOT EXISTS `EXTERNAL_DATA` ( - `external_data_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` int(11) DEFAULT NULL, - `param_name` varchar(30) NOT NULL, - `param_value` varchar(50) NOT NULL, - PRIMARY KEY (`external_data_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `FLOW_UPDATES` --- - -CREATE TABLE IF NOT EXISTS `FLOW_UPDATES` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `status` enum('NEW','COMPLETE','FAILED') NOT NULL DEFAULT 'NEW', - `create_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `last_processed_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `odl` varchar(128) DEFAULT NULL, - `address_family` enum('IPV4','IPV6') DEFAULT NULL, - `destination_prefix` varchar(50) DEFAULT NULL, - `communities` varchar(6000) DEFAULT NULL, - `route_key` varchar(50) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_L3_NETWORK` ( - `network_id` varchar(80) NOT NULL, - `network_name` varchar(80) DEFAULT NULL, - `network_type` varchar(80) DEFAULT NULL, - `network_role` varchar(80) DEFAULT NULL, - `network_technology` varchar(80) DEFAULT NULL, - `neutron_network_id` varchar(80) DEFAULT NULL, - `is_bound_to_vpn` tinyint(1) DEFAULT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `service_id` varchar(80) NOT NULL, - `tenant_id` varchar(80) NOT NULL, - `physical_location_id` varchar(20) DEFAULT NULL, - `network_role_instance` varchar(80) NOT NULL, - PRIMARY KEY (`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK_SUBNET` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_L3_NETWORK_SUBNET` ( - `network_id` varchar(80) NOT NULL, - `subnet_id` varchar(80) NOT NULL, - `neutron_subnet_id` varchar(80) DEFAULT NULL, - `gateway_address` varchar(45) NOT NULL, - `network_start_address` varchar(45) NOT NULL, - `cidr_mask` varchar(20) NOT NULL, - `ip_version` char(1) NOT NULL, - `orchestration_status` varchar(64) NOT NULL, - `dhcp_enabled` tinyint(1) NOT NULL, - `dhcp_start` varchar(45) DEFAULT NULL, - `dhcp_end` varchar(45) DEFAULT NULL, - PRIMARY KEY (`network_id`,`subnet_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_L3_NETWORK_VPN_BINDING` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_L3_NETWORK_VPN_BINDING` ( - `network_id` varchar(80) NOT NULL, - `vpn_id` varchar(80) NOT NULL, - PRIMARY KEY (`network_id`,`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_RESOURCE_NAME` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_RESOURCE_NAME` ( - `type` varchar(50) NOT NULL, - `name` varchar(255) NOT NULL, - `prefix` varchar(255) NULL, - `name_index` int(11) NULL, - `context_id` varchar(255) NULL, - PRIMARY KEY (`type`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF` ( - `vnf_id` varchar(80) NOT NULL, - `vnf_name` varchar(80) NOT NULL, - `vnf_type` varchar(200) NOT NULL, - `vnf_name2` varchar(80) DEFAULT NULL, - `service_id` varchar(80) NOT NULL, - `equipment_role` varchar(80) NOT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `prov_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `regional_resource_zone` varchar(80) DEFAULT NULL, - `operational_state` varchar(80) DEFAULT NULL, - `license_key` varchar(80) DEFAULT NULL, - `ipv4_oam_address` varchar(20) DEFAULT NULL, - `ipv4_loopback0_address` varchar(20) DEFAULT NULL, - `nm_lan_v6_address` varchar(40) DEFAULT NULL, - `management_v6_address` varchar(40) DEFAULT NULL, - `management_option` varchar(45) DEFAULT NULL, - `vcpu` varchar(45) DEFAULT NULL, - `vmemory` varchar(45) DEFAULT NULL, - `vdisk` varchar(45) DEFAULT NULL, - `vcpu_units` varchar(45) DEFAULT NULL, - `vmemory_units` varchar(45) DEFAULT NULL, - `vdisk_units` varchar(45) DEFAULT NULL, - PRIMARY KEY (`vnf_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_L3_NETWORK` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_L3_NETWORK` ( - `vnf_id` varchar(80) NOT NULL, - `network_id` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_id`,`network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_LICENSE_MANAGEMENT` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_LICENSE_MANAGEMENT` ( - `vnf_id` varchar(80) NOT NULL, - `att_uuid` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_id`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_LINTERFACE` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_LINTERFACE` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `interface_role` varchar(45) DEFAULT NULL, - `v6_wan_link_ip` varchar(45) DEFAULT NULL, - `selflink` varchar(128) DEFAULT NULL, - `interface_id` varchar(45) DEFAULT NULL, - `macaddr` varchar(64) DEFAULT NULL, - `network_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`), - KEY `FK_GENERIC_VNF_LINTERFACE_GENERIC_VNF_IDX` (`vnf_id`), - CONSTRAINT `FK_GENERIC_VNF_LINTERFACE_GENERIC_VNF` FOREIGN KEY (`vnf_id`) REFERENCES `GENERIC_VNF` (`vnf_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_PSERVER` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_PSERVER` ( - `vnf_id` varchar(64) NOT NULL, - `hostname` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_id`,`hostname`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_SERVICE_INSTANCE` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_SERVICE_INSTANCE` ( - `vnf_id` varchar(64) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - `relationship_key` varchar(64) NOT NULL, - `relationship_value` varchar(64) DEFAULT NULL, - `global_customer_id` varchar(255) DEFAULT NULL, - `service_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`service_instance_id`,`relationship_key`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_VNF_IMAGE` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_VNF_IMAGE` ( - `vnf_id` varchar(64) NOT NULL, - `att_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_id`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VNF_VSERVER` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VNF_VSERVER` ( - `vnf_id` varchar(80) NOT NULL, - `vserver_id` varchar(128) NOT NULL, - `tenant_id` varchar(128) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GENERIC_VPN_BINDING` --- - -CREATE TABLE IF NOT EXISTS `GENERIC_VPN_BINDING` ( - `vpn_id` varchar(80) NOT NULL, - `vpn_name` varchar(80) NOT NULL, - `global_route_target` varchar(80) NOT NULL, - PRIMARY KEY (`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `GET_CONFIG_TEMPLATE` --- - -CREATE TABLE IF NOT EXISTS `GET_CONFIG_TEMPLATE` ( - `get_config_template_id` int(11) NOT NULL AUTO_INCREMENT, - `vnf_type` varchar(50) NOT NULL, - `device_interface_protocol_id` int(11) NOT NULL, - `xml_processing` varchar(1) DEFAULT NULL, - `xml_protocol` varchar(30) DEFAULT NULL, - `template` longtext, - PRIMARY KEY (`get_config_template_id`), - UNIQUE KEY `get_config_template_id` (`get_config_template_id`), - KEY `get_config_template_ibfk_1` (`device_interface_protocol_id`), - CONSTRAINT `get_config_template_ibfk_1` FOREIGN KEY (`device_interface_protocol_id`) REFERENCES `DEVICE_INTERFACE_PROTOCOL` (`device_interface_protocol_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `LOCATION` --- - -CREATE TABLE IF NOT EXISTS `LOCATION` ( - `loc_id` int(11) NOT NULL AUTO_INCREMENT, - `address` varchar(150) NOT NULL, - `city_code_id` int(11) NOT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`loc_id`), - KEY `IN1_LOCATION_IDX` (`city_code_id`), - CONSTRAINT `FK1_LOCATION` FOREIGN KEY (`city_code_id`) REFERENCES `CITY_CODE` (`city_code_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB AUTO_INCREMENT=327 DEFAULT CHARSET=latin1; - --- --- Table structure for table `HOSTNAME` --- - -CREATE TABLE IF NOT EXISTS `HOSTNAME` ( - `hostname` varchar(21) NOT NULL, - `parent_hostname` varchar(21) DEFAULT NULL, - `cust_id` int(11) NOT NULL, - `loc_id` int(11) NOT NULL, - `site_sequence` varchar(2) NOT NULL, - `server_sequence` varchar(2) NOT NULL, - `activation_code` varchar(11) DEFAULT NULL, - `vnf_sequence` varchar(2) DEFAULT NULL, - `vendor_code` varchar(1) NOT NULL, - `virtual_device_type` varchar(2) DEFAULT NULL, - `device_sequence` varchar(3) DEFAULT NULL, - `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`hostname`), - KEY `IN1_HOSTNAME` (`cust_id`), - KEY `IN2_HOSTNAME` (`loc_id`), - KEY `IN3_HOSTNAME` (`vendor_code`), - KEY `IN4_HOSTNAME` (`parent_hostname`), - CONSTRAINT `FK1_HOSTNAME` FOREIGN KEY (`cust_id`) REFERENCES `CUSTOMER` (`cust_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK2_HOSTNAME` FOREIGN KEY (`loc_id`) REFERENCES `LOCATION` (`loc_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `FK4_HOSTNAME` FOREIGN KEY (`parent_hostname`) REFERENCES `HOSTNAME` (`hostname`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `IPV4_ADDRESS_POOL` --- - -CREATE TABLE IF NOT EXISTS `IPV4_ADDRESS_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `universe` varchar(40) NOT NULL, - `status` varchar(40) NOT NULL, - `ipv4_addr` varchar(20) NOT NULL, - PRIMARY KEY (`ipv4_addr`,`universe`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `LINK_MASTER` --- - -CREATE TABLE IF NOT EXISTS `LINK_MASTER` ( - `link_interface_ip` varchar(20) NOT NULL, - `source_crs_name` varchar(20) NOT NULL, - `destination_crs_name` varchar(20) NOT NULL, - `max_reserved_bw` int(11) DEFAULT NULL, - `default_cost` int(11) DEFAULT NULL, - `bundle_name` varchar(20) DEFAULT NULL, - PRIMARY KEY (`link_interface_ip`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `LINTERFACE_VLAN` --- - -CREATE TABLE IF NOT EXISTS `LINTERFACE_VLAN` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `vlan_id_inner` varchar(64) DEFAULT NULL, - `vlan_id_outer` varchar(64) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`), - KEY `FK_LINTERFACE_VLAN_GENERIC_VNF_LINTERFACE_IDX` (`vnf_id`,`interface_name`), - CONSTRAINT `FK_LINTERFACE_VLAN_GENERIC_VNF_LINTERFACE` FOREIGN KEY (`vnf_id`, `interface_name`) REFERENCES `GENERIC_VNF_LINTERFACE` (`vnf_id`, `interface_name`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `MAX_PORT_SPEED` --- - -CREATE TABLE IF NOT EXISTS `MAX_PORT_SPEED` ( - `max_port_speed_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `image_file_name` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `interface_name` varchar(100) NOT NULL, - `max_speed` bigint(20) NOT NULL, - `unit` varchar(10) NOT NULL, - PRIMARY KEY (`max_port_speed_id`), - UNIQUE KEY `max_port_speed_id` (`max_port_speed_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `MAX_SERVER_SPEED` --- - -CREATE TABLE IF NOT EXISTS `MAX_SERVER_SPEED` ( - `max_server_speed_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `server_model` varchar(50) NOT NULL, - `evc_count` smallint(6) NOT NULL, - `max_speed` bigint(20) NOT NULL, - `unit` varchar(10) NOT NULL, - `description` varchar(500) DEFAULT NULL, - PRIMARY KEY (`max_server_speed_id`), - UNIQUE KEY `max_server_speed_id` (`max_server_speed_id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; - --- --- Table structure for table `NAMING_POLICY_VM_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `NAMING_POLICY_VM_NAME_INDEX` ( - `vm_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vm_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NAMING_POLICY_VNFC_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `NAMING_POLICY_VNFC_NAME_INDEX` ( - `vnfc_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnfc_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_ASSIGN_VPN_OVERRIDE` --- - -CREATE TABLE IF NOT EXISTS `NBNC_ASSIGN_VPN_OVERRIDE` ( - `vpn_id` varchar(12) NOT NULL DEFAULT '', - `vpn_rt` varchar(16) NOT NULL DEFAULT '', - `service_type` varchar(16) NOT NULL DEFAULT '', - `be_location` varchar(16) NOT NULL DEFAULT '', - `be_type` varchar(32) NOT NULL DEFAULT '', - `be_id` varchar(32) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - PRIMARY KEY (`vpn_id`,`vpn_rt`,`service_type`,`be_location`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_BORDER_ELEMENT` --- - -CREATE TABLE IF NOT EXISTS `NBNC_BORDER_ELEMENT` ( - `be_id` varchar(32) NOT NULL, - `be_type` varchar(16) NOT NULL, - `be_name` varchar(32) DEFAULT NULL, - `be_host_vnf_id` varchar(32) DEFAULT NULL, - `service_type` varchar(16) DEFAULT NULL, - `tangibility` varchar(16) DEFAULT NULL, - `usage_order` smallint(6) DEFAULT NULL, - `vlan_start` smallint(6) DEFAULT NULL, - `vlan_end` smallint(6) DEFAULT NULL, - `ipv4_subnet` varchar(18) DEFAULT NULL, - `ipv6_subnet` varchar(68) DEFAULT NULL, - `network_ip` varchar(48) DEFAULT NULL, - `be_location` varchar(16) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - `log_link_model_uuid` varchar(64) DEFAULT NULL, - PRIMARY KEY (`be_id`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_IPE` --- - -CREATE TABLE IF NOT EXISTS `NBNC_IPE` ( - `ipe_name` varchar(32) NOT NULL, - `ipe_location` varchar(16) DEFAULT NULL, - `ipe_ip_address` varchar(16) DEFAULT NULL, - `ipe_id` varchar(8) DEFAULT NULL, - `service_type_array` varchar(512) DEFAULT NULL, - `ipe_status` varchar(32) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`ipe_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_IPE_PORT` --- - -CREATE TABLE IF NOT EXISTS `NBNC_IPE_PORT` ( - `port_id` varchar(16) NOT NULL, - `ipe_name` varchar(32) NOT NULL, - `be_id` varchar(32) NOT NULL, - `be_type` varchar(16) NOT NULL, - `port_type` varchar(16) DEFAULT NULL, - `ae_name` varchar(16) DEFAULT NULL, - `description` varchar(128) DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`port_id`,`ipe_name`,`be_id`,`be_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_MAPPING_SBG_BGF` --- - -CREATE TABLE IF NOT EXISTS `NBNC_MAPPING_SBG_BGF` ( - `asbg_vlan` smallint(6) NOT NULL, - `bgf_vlan` smallint(6) NOT NULL, - PRIMARY KEY (`asbg_vlan`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_SERVICE` --- - -CREATE TABLE IF NOT EXISTS `NBNC_SERVICE` ( - `service_type` varchar(16) NOT NULL, - `service_model_uuid` varchar(64) NOT NULL, - `description` varchar(128) DEFAULT NULL, - `created_timestamp` timestamp NULL DEFAULT NULL, - `updated_timestamp` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NBNC_SERVICE_VLAN` --- - -CREATE TABLE IF NOT EXISTS `NBNC_SERVICE_VLAN` ( - `be_id` varchar(32) NOT NULL, - `vlan` smallint(6) NOT NULL, - `service_type` varchar(16) DEFAULT NULL, - `be_type` varchar(16) DEFAULT NULL, - `be_name` varchar(32) DEFAULT NULL, - `be_host_vnf_id` varchar(32) DEFAULT NULL, - `be_location` varchar(16) DEFAULT NULL, - `be_usage_order` smallint(6) DEFAULT NULL, - `vlan_usage_order` smallint(6) DEFAULT NULL, - `status` varchar(16) DEFAULT 'AVAILABLE', - `request_id` varchar(64) DEFAULT NULL, - `service_instance_id` varchar(64) DEFAULT NULL, - `vni_id` varchar(16) DEFAULT NULL, - `customer_id` varchar(16) DEFAULT NULL, - `ipe1_router_name` varchar(32) DEFAULT NULL, - `ipe1_port_id` varchar(16) DEFAULT NULL, - `ipe1_ae_name` varchar(16) DEFAULT NULL, - `ipe2_router_name` varchar(32) DEFAULT NULL, - `ipe2_port_id` varchar(16) DEFAULT NULL, - `ipe2_ae_name` varchar(16) DEFAULT NULL, - `available_timestamp` timestamp NULL DEFAULT NULL, - `allocated_timestamp` timestamp NULL DEFAULT NULL, - `disabled_timestamp` timestamp NULL DEFAULT NULL, - `enabled_timestamp` timestamp NULL DEFAULT NULL, - `vpn_id` varchar(12) DEFAULT NULL, - `vpn_rt` varchar(16) DEFAULT NULL, - PRIMARY KEY (`be_id`,`vlan`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NCS_EXPECTED_ASYNC_REQUESTS` --- - -CREATE TABLE IF NOT EXISTS `NCS_EXPECTED_ASYNC_REQUESTS` ( - `ncs_request_id` varchar(255) NOT NULL, - `mso_gp_request_id` varchar(255) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - `sdn_module_name` varchar(255) NOT NULL, - `sdn_rpc_name` varchar(255) NOT NULL, - `sdn_service_action` varchar(255) DEFAULT NULL, - `ncs_rpc` varchar(255) NOT NULL, - `ncs_sub_action` varchar(255) DEFAULT NULL, - `status` varchar(255) NOT NULL DEFAULT 'inProgress', - `creation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`ncs_request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NETWORK_INSTANCE_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `NETWORK_INSTANCE_NAME_INDEX` ( - `network_instance_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`network_instance_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `SERVICE_MODEL` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_MODEL` ( - `service_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `description` varchar(1024) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `category` varchar(255) DEFAULT NULL, - `ecomp_naming` char(1) DEFAULT NULL, - `service_instance_name_prefix` varchar(255) DEFAULT NULL, - `filename` varchar(100) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - PRIMARY KEY (`service_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `NETWORK_MODEL` --- - -CREATE TABLE IF NOT EXISTS `NETWORK_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `service_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `network_type` varchar(255) DEFAULT NULL, - `network_role` varchar(255) DEFAULT NULL, - `network_technology` varchar(255) DEFAULT NULL, - `trunk_network_indicator` char(1) DEFAULT NULL, - `network_scope` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `is_shared_network` char(1) DEFAULT NULL, - `is_external_network` char(1) DEFAULT NULL, - `is_provider_network` char(1) DEFAULT NULL, - `physical_network_name` varchar(255) DEFAULT NULL, - `is_bound_to_vpn` char(1) DEFAULT NULL, - `vpn_binding` varchar(255) DEFAULT NULL, - `use_ipv4` char(1) DEFAULT NULL, - `ipv4_dhcp_enabled` char(1) DEFAULT NULL, - `ipv4_ip_version` char(1) DEFAULT NULL, - `ipv4_cidr_mask` varchar(255) DEFAULT NULL, - `eipam_v4_address_plan` varchar(255) DEFAULT NULL, - `use_ipv6` char(1) DEFAULT NULL, - `ipv6_dhcp_enabled` char(1) DEFAULT NULL, - `ipv6_ip_version` char(1) DEFAULT NULL, - `ipv6_cidr_mask` varchar(255) DEFAULT NULL, - `eipam_v6_address_plan` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`), - KEY `FK_NETWORK_MODEL` (`service_uuid`), - CONSTRAINT `FK_NETWORK_MODEL` FOREIGN KEY (`service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NETWORK_PROFILE` --- - -CREATE TABLE IF NOT EXISTS `NETWORK_PROFILE` ( - `network_type` varchar(100) NOT NULL, - `technology` varchar(100) NOT NULL, - PRIMARY KEY (`network_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NETWORK_ROLE_VPN_BINDING` --- - -CREATE TABLE IF NOT EXISTS `NETWORK_ROLE_VPN_BINDING` ( - `network_role` varchar(80) NOT NULL, - `vpn_id` varchar(80) NOT NULL, - PRIMARY KEY (`network_role`,`vpn_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `NODE_TYPES` --- - -CREATE TABLE IF NOT EXISTS `NODE_TYPES` ( - `nodetype` varchar(80) NOT NULL, - PRIMARY KEY (`nodetype`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `OBJECT_GROUPING` --- - -CREATE TABLE IF NOT EXISTS `OBJECT_GROUPING` ( - `group_id` varchar(128) NOT NULL, - `group_type` varchar(128) NOT NULL, - PRIMARY KEY (`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `OBJECT_GROUP_MEMBER_TRACKING` --- - -CREATE TABLE IF NOT EXISTS `OBJECT_GROUP_MEMBER_TRACKING` ( - `group_id` varchar(128) NOT NULL, - `key_id` varchar(128) NOT NULL, - `key_type` varchar(128) NOT NULL, - PRIMARY KEY (`group_id`,`key_id`,`key_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PARAMETERS` --- - -CREATE TABLE IF NOT EXISTS `PARAMETERS` ( - `name` varchar(100) NOT NULL, - `value` varchar(128) NOT NULL, - `category` varchar(24) DEFAULT NULL, - `memo` varchar(128) DEFAULT NULL, - PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PE_INV` --- - -CREATE TABLE IF NOT EXISTS `PE_INV` ( - `EQUIP_ID` int(11) DEFAULT NULL, - `EQUIP_TYPE` varchar(20) DEFAULT NULL, - `PTNII_EQUIP_NAME` varchar(20) DEFAULT NULL, - `IP_ADDR` varchar(15) DEFAULT NULL, - `ROUTER_PROV_STATUS` varchar(50) DEFAULT NULL, - `REGION` varchar(16) DEFAULT NULL, - `COUNTRY_ABBR` varchar(50) DEFAULT NULL, - `EQUIP_NAME_CODE` varchar(50) DEFAULT NULL, - `AS_NUMBER` varchar(5) DEFAULT NULL, - `LOOPBACK1` varchar(15) DEFAULT NULL, - `LOOPBACK2` varchar(15) DEFAULT NULL, - `LOOPBACK3` varchar(15) DEFAULT NULL, - `LOOPBACK40` varchar(15) DEFAULT NULL, - `LOOPBACK65535` varchar(15) DEFAULT NULL, - `INMS_LIST` varchar(20) DEFAULT NULL, - `ENCRYPTED_ACCESS_FLAG` varchar(50) DEFAULT NULL, - `SW_NAME` varchar(100) DEFAULT NULL, - `NMIPADDR` varchar(15) DEFAULT NULL, - `CREATE_DATE` datetime DEFAULT NULL, - `MOD_DATE` datetime DEFAULT NULL, - `FCN_CODE` varchar(50) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PHYSICAL_LINK` --- - -CREATE TABLE IF NOT EXISTS `PHYSICAL_LINK` ( - `link_name` varchar(255) NOT NULL, - `speed_value` varchar(64) DEFAULT NULL, - `speed_units` varchar(64) DEFAULT NULL, - `circuit_id` varchar(255) NOT NULL, - `dual_mode` varchar(64) NOT NULL, - PRIMARY KEY (`link_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PHYSICAL_LINK_PINTERFACE` --- - -CREATE TABLE IF NOT EXISTS `PHYSICAL_LINK_PINTERFACE` ( - `link_name` varchar(255) NOT NULL, - `hostname` varchar(255) NOT NULL, - `port_name_ft` varchar(255) NOT NULL, - PRIMARY KEY (`link_name`,`hostname`,`port_name_ft`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PINTERFACE` --- - -CREATE TABLE IF NOT EXISTS `PINTERFACE` ( - `hostname` varchar(255) NOT NULL, - `port_name_ft` varchar(255) NOT NULL, - `interface_name` varchar(255) DEFAULT '', - `physical_speed` varchar(255) DEFAULT '', - `physical_units` varchar(255) DEFAULT '', - `port_description` varchar(255) DEFAULT '', - PRIMARY KEY (`hostname`,`port_name_ft`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `POLICY_UPDATE_NOTIFICATION` --- - -CREATE TABLE IF NOT EXISTS `POLICY_UPDATE_NOTIFICATION` ( - `policy_name` varchar(255) NOT NULL, - `version_id` varchar(255) NOT NULL, - `update_type` varchar(255) NOT NULL, - `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`policy_name`,`version_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PORTAL_USERS` --- - -CREATE TABLE IF NOT EXISTS `PORTAL_USERS` ( - `email` varchar(64) NOT NULL, - `password` varbinary(255) NOT NULL, - `privilege` char(1) NOT NULL, - PRIMARY KEY (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - --- --- Table structure for table `PREPARE_FILE_RELATIONSHIP` --- - -CREATE TABLE IF NOT EXISTS `PREPARE_FILE_RELATIONSHIP` ( - `prepare_file_relationship_id` int(11) NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(50) DEFAULT NULL, - `request_id` varchar(255) DEFAULT NULL, - `config_file_id` int(11) DEFAULT NULL, - `asdc_artifacts_id` int(11) DEFAULT NULL, - PRIMARY KEY (`prepare_file_relationship_id`), - UNIQUE KEY `prepare_file_relationship_id` (`prepare_file_relationship_id`), - KEY `ie_prepare_file_relationship` (`config_file_id`), - KEY `ie2_prepare_file_relationship` (`asdc_artifacts_id`), - CONSTRAINT `prepare_file_relationship_ibfk_2` FOREIGN KEY (`asdc_artifacts_id`) REFERENCES `ASDC_ARTIFACTS` (`asdc_artifacts_id`) ON DELETE NO ACTION ON UPDATE CASCADE, - CONSTRAINT `prepare_file_replationship_ibfk_1` FOREIGN KEY (`config_file_id`) REFERENCES `CONFIGFILES` (`config_file_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `PRE_LOAD_VNF_DATA` --- - -CREATE TABLE IF NOT EXISTS `PRE_LOAD_VNF_DATA` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `svc_request_id` varchar(100) DEFAULT '', - `svc_action` varchar(40) DEFAULT '', - `status` varchar(10) NOT NULL DEFAULT 'pending', - `filename` varchar(100) NOT NULL, - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `preload_data` longblob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=295 DEFAULT CHARSET=latin1; - --- --- Table structure for table `PRE_LOAD_VNF_NETWORK_DATA` --- - -CREATE TABLE IF NOT EXISTS `PRE_LOAD_VNF_NETWORK_DATA` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `svc_request_id` varchar(100) DEFAULT '', - `svc_action` varchar(40) DEFAULT '', - `status` varchar(10) NOT NULL DEFAULT 'pending', - `filename` varchar(100) NOT NULL, - `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `preload_data` longblob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=278 DEFAULT CHARSET=latin1; - --- --- Table structure for table `PSERVER` --- - -CREATE TABLE IF NOT EXISTS `PSERVER` ( - `hostname` varchar(255) NOT NULL, - `ptnii_equip_name` varchar(255) DEFAULT '', - `number_of_cpus` varchar(255) DEFAULT '', - `disk_in_gigabytes` varchar(255) DEFAULT '', - `ram_in_megabytes` varchar(255) DEFAULT '', - `equip_type` varchar(255) DEFAULT '', - `equip_vendor` varchar(255) DEFAULT '', - `equip_model` varchar(255) DEFAULT '', - `fqdn` varchar(255) DEFAULT '', - `pserver_selflink` varchar(255) DEFAULT '', - `ipv4_oam_address` varchar(40) DEFAULT NULL, - `serial_number` varchar(255) DEFAULT '', - `pserver_id` varchar(255) DEFAULT '', - `internet_topology` varchar(40) DEFAULT '', - `aic_site_id` varchar(100) DEFAULT '', - `in_maint` varchar(5) DEFAULT '', - `pserver_name2` varchar(255) DEFAULT '', - `purpose` varchar(255) DEFAULT '', - PRIMARY KEY (`hostname`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `RANGE_RULE` --- - -CREATE TABLE IF NOT EXISTS `RANGE_RULE` ( - `range_rule_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `range_name` varchar(50) NOT NULL, - `service_model` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `equipment_level` varchar(50) NOT NULL, - `min_value` int(11) NOT NULL, - `max_value` int(11) NOT NULL, - PRIMARY KEY (`range_rule_id`) -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_DETAILS` --- - -CREATE TABLE IF NOT EXISTS `REQUEST_DETAILS` ( - `request_id` varchar(255) NOT NULL, - `controller_id` varchar(255) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `service_rate` varchar(255) DEFAULT NULL, - `service_instance_id` varchar(255) DEFAULT NULL, - `service_type` varchar(255) DEFAULT NULL, - `global_customer_id` varchar(255) DEFAULT NULL, - `notification_url` varchar(255) DEFAULT NULL, - `domain_requests` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_PROGRESS` --- - -CREATE TABLE IF NOT EXISTS `REQUEST_PROGRESS` ( - `request_id` int(11) NOT NULL AUTO_INCREMENT, - `request_type` varchar(20) DEFAULT NULL, - `service_instance_id` varchar(80) NOT NULL, - `request_instance_type` varchar(20) NOT NULL, - `originating_service_instance_id` varchar(80) DEFAULT NULL, - `originating_service_type` varchar(20) DEFAULT NULL, - `overall_status` varchar(20) DEFAULT NULL, - `status_date` varchar(80) DEFAULT NULL, - `message` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; - --- --- Table structure for table `REQUEST_PROGRESS_STATE` --- - -CREATE TABLE IF NOT EXISTS `REQUEST_PROGRESS_STATE` ( - `request_progress_state_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` int(11) DEFAULT NULL, - `service_instance_id` varchar(80) NOT NULL, - `request_instance_type` varchar(20) NOT NULL, - `progress_state` varchar(30) DEFAULT NULL, - `transaction_status` varchar(20) DEFAULT NULL, - `status_date` varchar(80) DEFAULT NULL, - `response_code` varchar(20) DEFAULT NULL, - `message` varchar(255) DEFAULT NULL, - PRIMARY KEY (`request_progress_state_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE` --- - -CREATE TABLE IF NOT EXISTS `RESOURCE` ( - `resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `asset_id` varchar(100) NOT NULL, - `resource_name` varchar(50) NOT NULL, - `resource_type` enum('Limit','Label','Range') NOT NULL, - `lt_used` bigint(20) DEFAULT NULL, - `ll_label` varchar(50) DEFAULT NULL, - `ll_reference_count` smallint(6) DEFAULT NULL, - `rr_used` varchar(4000) DEFAULT NULL, - PRIMARY KEY (`resource_id`), - UNIQUE KEY `resource_id` (`resource_id`), - UNIQUE KEY `IX1_RESOURCE` (`asset_id`,`resource_name`) -) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE_LOAD` --- - -CREATE TABLE IF NOT EXISTS `RESOURCE_LOAD` ( - `resource_load_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_id` bigint(20) NOT NULL, - `application_id` varchar(20) NOT NULL, - `resource_load_time` datetime NOT NULL, - `resource_expiration_time` datetime DEFAULT NULL, - PRIMARY KEY (`resource_load_id`), - UNIQUE KEY `resource_load_id` (`resource_load_id`), - UNIQUE KEY `IX2_RESOURCE_LOAD` (`resource_id`,`application_id`), - KEY `IX1_RESOURCE_LOAD` (`resource_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE_LOCK` --- - -CREATE TABLE IF NOT EXISTS `RESOURCE_LOCK` ( - `resource_lock_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_name` varchar(256) DEFAULT NULL, - `lock_holder` varchar(100) NOT NULL, - `lock_count` smallint(6) NOT NULL, - `lock_time` datetime NOT NULL, - `expiration_time` datetime NOT NULL, - PRIMARY KEY (`resource_lock_id`), - UNIQUE KEY `resource_lock_id` (`resource_lock_id`), - UNIQUE KEY `IX1_RESOURCE_LOCK` (`resource_name`) -) ENGINE=InnoDB AUTO_INCREMENT=29681 DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE_RULE` --- - -CREATE TABLE IF NOT EXISTS `RESOURCE_RULE` ( - `resource_rule_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_name` varchar(50) NOT NULL, - `service_model` varchar(50) NOT NULL, - `end_point_position` varchar(50) NOT NULL, - `service_expression` varchar(2000) NOT NULL, - `equipment_level` varchar(50) NOT NULL, - `equipment_expression` varchar(2000) NOT NULL, - `allocation_expression` varchar(2000) NOT NULL, - `soft_limit_expression` varchar(2000) NOT NULL, - `hard_limit_expression` varchar(2000) NOT NULL, - PRIMARY KEY (`resource_rule_id`), - UNIQUE KEY `resource_rule_id` (`resource_rule_id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1; - --- --- Table structure for table `RESOURCE_THRESHOLD` --- - -CREATE TABLE IF NOT EXISTS `RESOURCE_THRESHOLD` ( - `resource_threshold_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `resource_rule_id` bigint(20) NOT NULL, - `threshold_expression` varchar(2000) NOT NULL, - `threshold_message` varchar(2000) NOT NULL, - PRIMARY KEY (`resource_threshold_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - --- --- Table structure for table `ROUTER_MASTER` --- - -CREATE TABLE IF NOT EXISTS `ROUTER_MASTER` ( - `crs_name` varchar(20) NOT NULL, - `loopback_ip` varchar(20) NOT NULL, - PRIMARY KEY (`crs_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `ROUTING_CHARACTERISTIC_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `ROUTING_CHARACTERISTIC_MAPPING` ( - `network_role` varchar(255) NOT NULL, - `vrf_name` varchar(255) NOT NULL, - `routing_characteristic` varchar(255) NOT NULL, - PRIMARY KEY (`network_role`,`vrf_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_HOMING` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_HOMING` ( - `service_type` varchar(100) NOT NULL, - `lata` int(3) NOT NULL, - `hubbing_city_type` varchar(40) NOT NULL, - `latitude` float DEFAULT NULL, - `longitude` float DEFAULT NULL, - `primary_aic_site_name` varchar(100) NOT NULL, - `secondary_aic_site_name` varchar(100) DEFAULT NULL, - `tertiary_aic_site_name` varchar(100) DEFAULT NULL, - PRIMARY KEY (`service_type`,`lata`,`hubbing_city_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_HOMING_BACKUP` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_HOMING_BACKUP` ( - `service_type` varchar(100) NOT NULL, - `lata` int(3) NOT NULL, - `hubbing_city_type` varchar(40) NOT NULL, - `latitude` float DEFAULT NULL, - `longitude` float DEFAULT NULL, - `primary_aic_site_name` varchar(100) NOT NULL, - `secondary_aic_site_name` varchar(100) DEFAULT NULL, - `tertiary_aic_site_name` varchar(100) DEFAULT NULL, - PRIMARY KEY (`service_type`,`lata`,`hubbing_city_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_INSTANCE_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_INSTANCE_NAME_INDEX` ( - `service_instance_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`service_instance_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_MANAGER_CREDENTIALS` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_MANAGER_CREDENTIALS` ( - `service_manager_username` varchar(255) NOT NULL, - `service_manager_password` varbinary(255) NOT NULL, - PRIMARY KEY (`service_manager_username`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_PROXY` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_PROXY` ( - `port_mirror_service_uuid` varchar(255) NOT NULL, - `service_proxy_name` varchar(255) NOT NULL, - `source_service_uuid` varchar(255) NOT NULL, - `resources_vendor` varchar(255) DEFAULT NULL, - `resource_vendor_release` varchar(255) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `category` varchar(255) DEFAULT NULL, - `subcategory` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `role` varchar(255) NOT NULL, - `uuid` varchar(255) DEFAULT NULL, - `customization_uuid` varchar(255) DEFAULT NULL, - `invariant_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`port_mirror_service_uuid`,`service_proxy_name`), - KEY `FK_SERVICE_PROXY_SOURCE_TO_SERVICE_MODE` (`source_service_uuid`), - CONSTRAINT `FK_SERVICE_PROXY_MIRROR_TO_SERVICE_MODE` FOREIGN KEY (`port_mirror_service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE CASCADE ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_RESOURCE` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_RESOURCE` ( - `service_resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `service_instance_id` varchar(80) NOT NULL, - `service_status` enum('Active','Pending') NOT NULL, - `service_change_number` smallint(6) NOT NULL, - `resource_set_id` varchar(100) NOT NULL, - `resource_union_id` varchar(100) NOT NULL, - PRIMARY KEY (`service_instance_id`,`service_change_number`), - UNIQUE KEY `service_resource_id` (`service_resource_id`), - KEY `IX1_SERVICE_RESOURCE` (`service_instance_id`) -) ENGINE=InnoDB AUTO_INCREMENT=955 DEFAULT CHARSET=latin1; - --- --- Table structure for table `SERVICE_TYPE_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `SERVICE_TYPE_MAPPING` ( - `sdnc_service_type` varchar(128) NOT NULL, - `ncs_service_type` varchar(128) NOT NULL, - PRIMARY KEY (`sdnc_service_type`,`ncs_service_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SUBNETPOOL_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `SUBNETPOOL_MAPPING` ( - `aic_cloud_region` varchar(16) NOT NULL, - `ntc` varchar(32) NOT NULL, - `lcp` varchar(32) NOT NULL, - `aic_region_id` varchar(255) NOT NULL, - PRIMARY KEY (`aic_cloud_region`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SUPPORTED_SEQUENCE_NUMBER` --- - -CREATE TABLE IF NOT EXISTS `SUPPORTED_SEQUENCE_NUMBER` ( - `resource_sequence_number` varchar(10) NOT NULL, - `resource_type` varchar(10) NOT NULL, - PRIMARY KEY (`resource_sequence_number`,`resource_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `SVC_LOGIC` --- - -CREATE TABLE IF NOT EXISTS `SVC_LOGIC` ( - `module` varchar(80) NOT NULL, - `rpc` varchar(80) NOT NULL, - `version` varchar(40) NOT NULL, - `mode` varchar(5) NOT NULL, - `active` varchar(1) NOT NULL, - `graph` longblob, - `modified_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `md5sum` varchar(128) DEFAULT NULL, - PRIMARY KEY (`module`,`rpc`,`version`,`mode`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TABLE_CLEANUP_CONFIGURATION` --- - -CREATE TABLE IF NOT EXISTS `TABLE_CLEANUP_CONFIGURATION` ( - `table_name` varchar(255) NOT NULL COMMENT 'The name of the table the cleanup will be performed on', - `days_old` int(11) NOT NULL COMMENT 'Records older than the current date minus DAYS_OLD will be deleted', - `date_column` varchar(255) NOT NULL COMMENT 'The name of the column containing the date to be checked', - `commit_interval` int(11) NOT NULL DEFAULT '2500' COMMENT 'The maximum number of rows a commit may contain', - `query_clause` varchar(1000) DEFAULT NULL COMMENT 'An optional additional query clause to further restrict deletion criteria', - `child_table_name` varchar(255) DEFAULT NULL, - `child_table_pk` varchar(255) DEFAULT NULL, - PRIMARY KEY (`table_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table will be used by the table clean-up script, tableCleanup.sh, to drive what tables should be purged and what the purge criteria are.'; - --- --- Table structure for table `TASK_TEMPLATE` --- - -CREATE TABLE IF NOT EXISTS `TASK_TEMPLATE` ( - `task_template_id` int(11) NOT NULL AUTO_INCREMENT, - `request_type` varchar(20) DEFAULT NULL, - `task_name` varchar(30) NOT NULL, - `task_category` varchar(50) NOT NULL, - `ecomp_task` varchar(50) NOT NULL, - `initial_load` varchar(1) NOT NULL, - `service` varchar(20) DEFAULT NULL, - PRIMARY KEY (`task_template_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - --- --- Table structure for table `TENANT` --- - -CREATE TABLE IF NOT EXISTS `TENANT` ( - `tenant_id` varchar(255) NOT NULL, - `tenant_name` varchar(255) NOT NULL, - `service_instance_id` varchar(255) NOT NULL, - PRIMARY KEY (`tenant_id`,`tenant_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TESTTBL` --- - -CREATE TABLE IF NOT EXISTS `TESTTBL` ( - `pk` varchar(25) NOT NULL, - `col1` varchar(25) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `THRESHOLD_NOTIFICATION` --- - -CREATE TABLE IF NOT EXISTS `THRESHOLD_NOTIFICATION` ( - `resource_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `threshold_expression` varchar(2000) DEFAULT NULL, - `threshold_message` varchar(500) DEFAULT NULL, - PRIMARY KEY (`resource_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TMP_AIC_AVAIL_ZONE_POOL` --- - -CREATE TABLE IF NOT EXISTS `TMP_AIC_AVAIL_ZONE_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `status` varchar(40) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `token` int(4) NOT NULL, - `vnf_id` varchar(80) DEFAULT NULL, - `service_type` varchar(100) NOT NULL, - `vnf_type` varchar(20) DEFAULT NULL, - `hypervisor` varchar(10) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`token`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TOPOLOGY_PARAMETER` --- - -CREATE TABLE IF NOT EXISTS `TOPOLOGY_PARAMETER` ( - `parameter_id` int(11) NOT NULL, - `parameter_name` varchar(20) NOT NULL, - `parameter_set` int(11) NOT NULL, - `create_update_time` datetime NOT NULL, - `create_update_user` varchar(40) NOT NULL, - PRIMARY KEY (`parameter_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TOPOLOGY_PARAMETER_ENTRIES` --- - -CREATE TABLE IF NOT EXISTS `TOPOLOGY_PARAMETER_ENTRIES` ( - `parameter_entry_id` int(11) NOT NULL, - `parameter_name` varchar(255) NOT NULL, - `parameter_value` varchar(64) NOT NULL, - `create_update_time` datetime NOT NULL, - `create_update_user` varchar(40) NOT NULL, - PRIMARY KEY (`parameter_entry_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TOPOLOGY_PARAMETER_TO_ENTRIES` --- - -CREATE TABLE IF NOT EXISTS `TOPOLOGY_PARAMETER_TO_ENTRIES` ( - `parameter_id` int(11) DEFAULT NULL, - `parameter_entry_id` int(11) DEFAULT NULL, - `entry_order` int(11) DEFAULT NULL, - `create_update_time` datetime DEFAULT NULL, - `create_update_user` varchar(40) NOT NULL, - KEY `FK1_TOPOLOGY_PARAMETER_TO_ENTRIES` (`parameter_id`), - KEY `FK2_TOPOLOGY_PARAMETER_TO_ENTRIES` (`parameter_entry_id`), - CONSTRAINT `FK1_TOPOLOGY_PARAMETER_TO_ENTRIES` FOREIGN KEY (`parameter_id`) REFERENCES `TOPOLOGY_PARAMETER` (`parameter_id`), - CONSTRAINT `FK2_TOPOLOGY_PARAMETER_TO_ENTRIES` FOREIGN KEY (`parameter_entry_id`) REFERENCES `TOPOLOGY_PARAMETER_ENTRIES` (`parameter_entry_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE` --- - -CREATE TABLE IF NOT EXISTS `TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE` ( - `interface_name` varchar(255) NOT NULL, - `interface_id` varchar(255) NOT NULL, - `pnf_name` varchar(255) NOT NULL, - `pnf_id` varchar(255) NOT NULL, - `controller_id` varchar(255) DEFAULT NULL, - `rate` varchar(255) DEFAULT NULL, - `clli` varchar(255) DEFAULT NULL, - `connection_point` varchar(255) DEFAULT NULL, - PRIMARY KEY (`interface_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `TRANSACTION_LOG` --- - -CREATE TABLE IF NOT EXISTS `TRANSACTION_LOG` ( - `serial_key` int(10) NOT NULL AUTO_INCREMENT, - `log_time` varchar(40) NOT NULL, - `request_id` varchar(80) DEFAULT NULL, - `svc_request_id` varchar(80) DEFAULT NULL, - `x_ecomp_request_id` varchar(80) DEFAULT NULL, - `graph_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`serial_key`) -) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=latin1; - - --- --- Table structure for table `UPLOAD_CONFIG` --- - -CREATE TABLE IF NOT EXISTS `UPLOAD_CONFIG` ( - `upload_config_id` int(11) NOT NULL AUTO_INCREMENT, - `request_id` varchar(50) DEFAULT NULL, - `originator_id` varchar(50) DEFAULT NULL, - `service_description` varchar(100) DEFAULT NULL, - `action` varchar(50) DEFAULT NULL, - `upload_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `vnf_id` varchar(50) DEFAULT NULL, - `vnf_name` varchar(50) DEFAULT NULL, - `vm_name` varchar(50) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `host_ip_address` varchar(50) DEFAULT NULL, - `config_indicator` varchar(25) DEFAULT NULL, - `pending_delete` varchar(1) DEFAULT NULL, - `content` longtext, - PRIMARY KEY (`upload_config_id`), - UNIQUE KEY `upload_config_id` (`upload_config_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; - --- --- Table structure for table `USED_SEQUENCE_NUMBER` --- - -CREATE TABLE IF NOT EXISTS `USED_SEQUENCE_NUMBER` ( - `resource_sequence_number` varchar(10) NOT NULL, - `resource_type` varchar(10) NOT NULL, - `zone_region_id` varchar(50) NOT NULL, - PRIMARY KEY (`resource_sequence_number`,`resource_type`,`zone_region_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `USER_TRACE` --- - -CREATE TABLE IF NOT EXISTS `USER_TRACE` ( - `user_trace_seq` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `identity` varchar(12) DEFAULT NULL, - `action` varchar(128) DEFAULT NULL, - `description` varchar(256) DEFAULT NULL, - PRIMARY KEY (`user_trace_seq`) -) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VENDOR_CODE` --- - -CREATE TABLE IF NOT EXISTS `VENDOR_CODE` ( - `vendor_code` varchar(1) NOT NULL, - `vendor` varchar(45) NOT NULL DEFAULT '', - PRIMARY KEY (`vendor_code`,`vendor`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VFC_MODEL` --- - -CREATE TABLE IF NOT EXISTS `VFC_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `nfc_function` varchar(255) DEFAULT NULL, - `nfc_naming_code` varchar(255) DEFAULT NULL, - `vm_type` varchar(255) DEFAULT NULL, - `vm_type_tag` varchar(255) DEFAULT NULL, - `vm_image_name` varchar(255) DEFAULT NULL, - `vm_flavor_name` varchar(255) DEFAULT NULL, - `high_availability` varchar(255) DEFAULT NULL, - `nfc_naming` varchar(255) DEFAULT NULL, - `min_instances` int(11) DEFAULT NULL, - `max_instances` int(11) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VFC_TO_NETWORK_ROLE_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VFC_TO_NETWORK_ROLE_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vfc_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `vm_type` varchar(255) DEFAULT NULL, - `network_role_tag` varchar(255) DEFAULT NULL, - `ipv4_count` int(11) NOT NULL, - `ipv6_count` int(11) NOT NULL, - `ipv4_use_dhcp` char(1) DEFAULT NULL, - `ipv6_use_dhcp` char(1) DEFAULT NULL, - `ipv4_ip_version` char(1) DEFAULT NULL, - `ipv6_ip_version` char(1) DEFAULT NULL, - `extcp_subnetpool_id` varchar(512) DEFAULT NULL, - `ipv4_floating_count` int(11) DEFAULT NULL, - `ipv6_floating_count` int(11) DEFAULT NULL, - `ipv4_address_plan_name` varchar(512) DEFAULT NULL, - `ipv6_address_plan_name` varchar(512) DEFAULT NULL, - `ipv4_vrf_name` varchar(512) DEFAULT NULL, - `ipv6_vrf_name` varchar(512) DEFAULT NULL, - `subnet_role` varchar(255) DEFAULT NULL, - `subinterface_indicator` char(1) DEFAULT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VFC_TO_NETWORK_ROLE_MAPPING` (`vfc_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=1791 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODEL` --- - -CREATE TABLE IF NOT EXISTS `VF_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `naming_policy` varchar(255) DEFAULT NULL, - `ecomp_generated_naming` char(1) DEFAULT NULL, - `avail_zone_max_count` int(11) DEFAULT NULL, - `nf_function` varchar(255) DEFAULT NULL, - `nf_code` varchar(255) DEFAULT NULL, - `nf_type` varchar(255) DEFAULT NULL, - `nf_role` varchar(255) DEFAULT NULL, - `vendor` varchar(255) DEFAULT NULL, - `vendor_version` varchar(255) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODULE_MODEL` --- - -CREATE TABLE IF NOT EXISTS `VF_MODULE_MODEL` ( - `customization_uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) DEFAULT NULL, - `uuid` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `vf_module_type` varchar(255) DEFAULT NULL, - `availability_zone_count` int(11) DEFAULT NULL, - `ecomp_generated_vm_assignments` char(1) DEFAULT NULL, - PRIMARY KEY (`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_MODULE_TO_VFC_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VF_MODULE_TO_VFC_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vf_module_customization_uuid` varchar(255) NOT NULL, - `vfc_customization_uuid` varchar(255) NOT NULL, - `vm_type` varchar(255) NOT NULL, - `vm_count` int(11) NOT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VF_MODULE_TO_VFC_MAPPING` (`vf_module_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=1591 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VF_TO_NETWORK_ROLE_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VF_TO_NETWORK_ROLE_MAPPING` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `vf_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - PRIMARY KEY (`seq`), - KEY `IX1_VF_TO_NETWORK_ROLE_MAPPING` (`vf_customization_uuid`) -) ENGINE=InnoDB AUTO_INCREMENT=348 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VIPR_CONFIGURATION` --- - -CREATE TABLE IF NOT EXISTS `VIPR_CONFIGURATION` ( - `seq` int(11) NOT NULL AUTO_INCREMENT, - `serial_number` varchar(255) DEFAULT NULL, - `vnf_id` varchar(255) DEFAULT NULL, - `vnf_name` varchar(255) DEFAULT NULL, - `ecomp_service_instance_id` varchar(255) DEFAULT NULL, - `vm_name` varchar(255) DEFAULT NULL, - `cloud_region_id` varchar(255) DEFAULT NULL, - `cloud_owner` varchar(255) DEFAULT NULL, - PRIMARY KEY (`seq`) -) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VIPR_SZ_MANAGER_KEY` --- - -CREATE TABLE IF NOT EXISTS `VIPR_SZ_MANAGER_KEY` ( - `vipr_sz_manager_ip_addr` varchar(40) NOT NULL, - `vipr_sz_manager_state` varchar(10) DEFAULT NULL, - `vipr_sz_manager_api_key` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vipr_sz_manager_ip_addr`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_ID_POOL` --- - -CREATE TABLE IF NOT EXISTS `VLAN_ID_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `purpose` varchar(40) NOT NULL, - `status` varchar(40) NOT NULL, - `vlan_id` int(4) NOT NULL, - `svc_instance_id` varchar(80) DEFAULT NULL, - `availability_zone` varchar(100) DEFAULT NULL, - `vplspe_name` varchar(80) DEFAULT NULL, - PRIMARY KEY (`vlan_id`,`aic_site_id`,`purpose`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_L3INTERFACE_IPV4_ADDRESS` --- - -CREATE TABLE IF NOT EXISTS `VLAN_L3INTERFACE_IPV4_ADDRESS` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `l3_interface_ipv4_address` varchar(64) NOT NULL, - `l3_interface_ipv4_prefix_length` varchar(45) DEFAULT NULL, - `vlan_id_inner` varchar(45) DEFAULT NULL, - `vlan_id_outer` varchar(45) DEFAULT NULL, - `is_floating` varchar(1) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`,`l3_interface_ipv4_address`), - KEY `FK_VLAN_L3INTERFACE_IPV4_ADDRESS_LINTERFACE_VLAN_IDX` (`vnf_id`,`interface_name`), - CONSTRAINT `FK_VLAN_L3INTERFACE_IPV4_ADDRESS_LINTERFACE_VLAN` FOREIGN KEY (`vnf_id`, `interface_name`, `vlan_interface`) REFERENCES `LINTERFACE_VLAN` (`vnf_id`, `interface_name`, `vlan_interface`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_L3INTERFACE_IPV6_ADDRESS` --- - -CREATE TABLE IF NOT EXISTS `VLAN_L3INTERFACE_IPV6_ADDRESS` ( - `vnf_id` varchar(80) NOT NULL, - `interface_name` varchar(255) NOT NULL, - `vlan_interface` varchar(255) NOT NULL, - `l3_interface_ipv6_address` varchar(64) NOT NULL, - `l3_interface_ipv6_prefix_length` varchar(45) DEFAULT NULL, - `vlan_id_inner` varchar(45) DEFAULT NULL, - `vlan_id_outer` varchar(45) DEFAULT NULL, - `is_floating` varchar(1) DEFAULT NULL, - PRIMARY KEY (`vnf_id`,`interface_name`,`vlan_interface`,`l3_interface_ipv6_address`), - KEY `FK_VLAN_L3INTERFACE_IPV6_ADDRESS_LINTERFACE_VLAN_IDX` (`vnf_id`,`interface_name`,`vlan_interface`), - CONSTRAINT `FK_VLAN_L3INTERFACE_IPV6_ADDRESS_LINTERFACE_VLAN` FOREIGN KEY (`vnf_id`, `interface_name`, `vlan_interface`) REFERENCES `LINTERFACE_VLAN` (`vnf_id`, `interface_name`, `vlan_interface`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_PLAN_ID` --- - -CREATE TABLE IF NOT EXISTS `VLAN_PLAN_ID` ( - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `vlan_plan_id_count` int(4) NOT NULL, - PRIMARY KEY (`vlan_plan_id_count`,`plan_type`,`purpose`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_POOL` --- - -CREATE TABLE IF NOT EXISTS `VLAN_POOL` ( - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `vlan_plan_id` varchar(100) NOT NULL, - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `vlan_id` int(4) NOT NULL, - `status` varchar(40) NOT NULL, - `reserved_id` varchar(80) DEFAULT NULL, - PRIMARY KEY (`aic_site_id`,`availability_zone`,`vlan_plan_id`,`plan_type`,`purpose`,`vlan_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VLAN_RANGES` --- - -CREATE TABLE IF NOT EXISTS `VLAN_RANGES` ( - `vlan_plan_id` varchar(100) NOT NULL, - `plan_type` varchar(40) NOT NULL, - `purpose` varchar(40) NOT NULL, - `range_start` int(4) NOT NULL, - `range_end` int(4) NOT NULL, - `generated` char(1) DEFAULT NULL, - PRIMARY KEY (`vlan_plan_id`,`plan_type`,`purpose`,`range_start`,`range_end`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VM_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `VM_NAME_INDEX` ( - `vm_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vm_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VM_NETWORKS` --- - -CREATE TABLE IF NOT EXISTS `VM_NETWORKS` ( - `vnf_type` varchar(200) NOT NULL, - `vm_type` varchar(45) NOT NULL, - `network_role` varchar(45) NOT NULL, - `assign_ips` tinyint(1) NOT NULL, - `assign_macs` tinyint(1) NOT NULL, - `assign_floating_ip` tinyint(1) NOT NULL, - `ip_count` int(11) DEFAULT NULL, - PRIMARY KEY (`vnf_type`,`vm_type`,`network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VM_PROFILE` --- - -CREATE TABLE IF NOT EXISTS `VM_PROFILE` ( - `vnf_type` varchar(200) NOT NULL, - `vm_type` varchar(45) NOT NULL, - `vm_count` int(11) NOT NULL, - PRIMARY KEY (`vnf_type`,`vm_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF` --- - -CREATE TABLE IF NOT EXISTS `VNF` ( - `vnf_id` varchar(80) NOT NULL, - `vnf_name` varchar(80) NOT NULL, - `vnf_type` varchar(10) NOT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `availability_zone` varchar(80) DEFAULT NULL, - `aic_site_id` varchar(80) DEFAULT NULL, - `oam_ipv4_address` varchar(20) DEFAULT NULL, - `vnf_name2` varchar(80) DEFAULT NULL, - `vpe_id` varchar(80) NOT NULL, - `ipv4_loopback0_address` varchar(80) DEFAULT NULL, - `license_key` varchar(256) DEFAULT NULL, - `entitlement_resource_uuid` varchar(256) DEFAULT NULL, - PRIMARY KEY (`vnf_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNFC_DG_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VNFC_DG_MAPPING` ( - `vnfc_dg_mapping_id` int(11) NOT NULL AUTO_INCREMENT, - `action` varchar(50) DEFAULT NULL, - `api_version` varchar(10) DEFAULT NULL, - `vnf_type` varchar(50) DEFAULT NULL, - `vnfc_type` varchar(50) DEFAULT NULL, - `dg_name` varchar(50) NOT NULL, - `dg_version` varchar(50) DEFAULT NULL, - `dg_module` varchar(50) NOT NULL, - PRIMARY KEY (`vnfc_dg_mapping_id`), - UNIQUE KEY `input_constraint` (`action`,`api_version`,`vnf_type`,`vnfc_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNFC_REFERENCE` --- - -CREATE TABLE IF NOT EXISTS `VNFC_REFERENCE` ( - `vnfc_reference_id` int(11) NOT NULL AUTO_INCREMENT, - `action` varchar(50) NOT NULL, - `vnf_type` varchar(50) NOT NULL, - `vm_instance` int(11) NOT NULL, - `vnfc_instance` int(11) NOT NULL, - `vnfc_type` varchar(50) NOT NULL, - `vnfc_function_code` varchar(50) NOT NULL, - `ipaddress_v4_oam_vip` varchar(50) DEFAULT NULL, - `group_notation_type` varchar(50) DEFAULT NULL, - `group_notation_value` varchar(50) DEFAULT NULL, - PRIMARY KEY (`vnfc_reference_id`), - UNIQUE KEY `vnfc_reference_id` (`vnfc_reference_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_IMAGE` --- - -CREATE TABLE IF NOT EXISTS `VNF_IMAGE` ( - `application_vendor` varchar(255) NOT NULL, - `application_version` varchar(255) NOT NULL, - `att_uuid` varchar(255) NOT NULL, - `application` varchar(255) DEFAULT NULL, - `selflink` varchar(255) DEFAULT NULL, - PRIMARY KEY (`application_vendor`,`application_version`,`att_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_MODEL_LICENSES` --- - -CREATE TABLE IF NOT EXISTS `VNF_MODEL_LICENSES` ( - `att_part_number` varchar(255) NOT NULL, - `license_assignment_group` varchar(255) NOT NULL, - `license_required` tinyint(1) DEFAULT NULL, - `entitlement_assignment_group` varchar(255) DEFAULT NULL, - `entitlement_required` tinyint(1) DEFAULT '0', - `feature_group_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`att_part_number`,`license_assignment_group`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_MODEL_LICENSE_FEATURES` --- - -CREATE TABLE IF NOT EXISTS `VNF_MODEL_LICENSE_FEATURES` ( - `att_part_number` varchar(255) NOT NULL, - `license_assignment_group` varchar(255) NOT NULL, - `feature` varchar(255) NOT NULL, - PRIMARY KEY (`att_part_number`,`license_assignment_group`,`feature`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_NAME_INDEX` --- - -CREATE TABLE IF NOT EXISTS `VNF_NAME_INDEX` ( - `vnf_name_prefix` varchar(255) NOT NULL, - `index_number` int(11) NOT NULL, - PRIMARY KEY (`vnf_name_prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_NETWORKS` --- - -CREATE TABLE IF NOT EXISTS `VNF_NETWORKS` ( - `vnf_type` varchar(200) NOT NULL, - `network_role` varchar(45) NOT NULL, - PRIMARY KEY (`vnf_type`,`network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_NETWORK_CONNECTION` --- - -CREATE TABLE IF NOT EXISTS `VNF_NETWORK_CONNECTION` ( - `connection_uuid` varchar(80) NOT NULL, - `vnf_id` varchar(80) NOT NULL, - `connection_id` varchar(80) DEFAULT NULL, - `connection_type` varchar(20) DEFAULT NULL, - `neutron_network_id` varchar(80) DEFAULT NULL, - `neutron_network_name` varchar(80) DEFAULT NULL, - `orchestration_status` varchar(20) DEFAULT NULL, - `switch_id` varchar(40) DEFAULT NULL, - `heat_stack_id` varchar(80) DEFAULT NULL, - `mso_catalog_key` varchar(80) DEFAULT NULL, - `provider_network` varchar(80) DEFAULT NULL, - `port_group_id` varchar(80) DEFAULT NULL, - `port_group_name` varchar(80) DEFAULT NULL, - PRIMARY KEY (`connection_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_NETWORK_CONNECTION_VLAN` --- - -CREATE TABLE IF NOT EXISTS `VNF_NETWORK_CONNECTION_VLAN` ( - `vlan_uuid` varchar(80) NOT NULL, - `vlan_id` int(4) NOT NULL, - `vlan_type` varchar(5) NOT NULL, - `connection_uuid` varchar(80) DEFAULT NULL, - PRIMARY KEY (`vlan_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_PROFILE` --- - -CREATE TABLE IF NOT EXISTS `VNF_PROFILE` ( - `vnf_type` varchar(200) NOT NULL, - `availability_zone_count` int(11) NOT NULL, - `equipment_role` varchar(80) NOT NULL, - PRIMARY KEY (`vnf_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VNF_SERVICE_TO_NETWORK_ROLE_FILTER` --- - -CREATE TABLE IF NOT EXISTS `VNF_SERVICE_TO_NETWORK_ROLE_FILTER` ( - `vnf_service_type` varchar(60) NOT NULL, - `network_role_filter` varchar(60) NOT NULL, - PRIMARY KEY (`vnf_service_type`,`network_role_filter`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPE_LOCK` --- - -CREATE TABLE IF NOT EXISTS `VPE_LOCK` ( - `vpe_name` varchar(20) NOT NULL, - `vpn_lock` varchar(20) NOT NULL, - PRIMARY KEY (`vpe_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPE_MAC_ADDRESS_POOL` --- - -CREATE TABLE IF NOT EXISTS `VPE_MAC_ADDRESS_POOL` ( - `id` int(11) NOT NULL, - `mac_address` varchar(50) NOT NULL, - `sw_name` varchar(30) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING` ( - `id` int(11) NOT NULL, - `hostname` varchar(50) NOT NULL, - `assigned_user` varchar(25) NOT NULL, - `assigned_date` date DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPE_POOL` --- - -CREATE TABLE IF NOT EXISTS `VPE_POOL` ( - `vpe_name` varchar(20) NOT NULL, - `ipv4_oam_address` varchar(20) NOT NULL, - `loopback0_ipv4_address` varchar(20) NOT NULL, - `provisioning_status` varchar(10) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `vlan_id_outer` varchar(20) NOT NULL, - `vendor` varchar(20) NOT NULL, - `physical_intf_name` varchar(40) NOT NULL, - `physical_intf_speed` varchar(20) NOT NULL, - `physical_intf_units` varchar(20) NOT NULL, - `vpe_uuid` varchar(80) DEFAULT NULL, - `vpe_id` varchar(80) NOT NULL, - `image_filename` varchar(100) DEFAULT NULL, - `as_number` varchar(20) NOT NULL, - `loopback5000` varchar(16) DEFAULT NULL, - `loopback10` varchar(16) DEFAULT NULL, - `aic_version` varchar(50) DEFAULT NULL, - `vpe_capacity` int(11) NOT NULL, - PRIMARY KEY (`aic_site_id`,`vpe_name`,`availability_zone`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPLSPE_POOL` --- - -CREATE TABLE IF NOT EXISTS `VPLSPE_POOL` ( - `vplspe_name` varchar(20) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `availability_zone` varchar(100) NOT NULL, - `physical_intf_name` varchar(40) NOT NULL, - `physical_intf_speed` varchar(20) NOT NULL, - `physical_intf_units` varchar(20) NOT NULL, - `loopback0_ipv4_address` varchar(20) NOT NULL, - `vlan_id_outer` varchar(20) NOT NULL, - `vplspe_uuid` varchar(80) DEFAULT NULL, - `image_filename` varchar(100) DEFAULT NULL, - `provisioning_status` varchar(10) DEFAULT NULL, - `vendor` varchar(20) DEFAULT NULL, - PRIMARY KEY (`vplspe_name`,`aic_site_id`,`availability_zone`,`physical_intf_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VPN_BINDINGS` --- - -CREATE TABLE IF NOT EXISTS `VPN_BINDINGS` ( - `network_customization_uuid` varchar(255) NOT NULL, - `binding_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`network_customization_uuid`,`binding_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VRR_FUNCTION_CODE_VMTYPE_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VRR_FUNCTION_CODE_VMTYPE_MAPPING` ( - `ptnii_function_code` varchar(128) NOT NULL, - `vm_type` varchar(128) NOT NULL, - PRIMARY KEY (`ptnii_function_code`,`vm_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VSERVER` --- - -CREATE TABLE IF NOT EXISTS `VSERVER` ( - `tenant_id` varchar(40) NOT NULL, - `vserver_id` varchar(40) NOT NULL, - `aic_site_id` varchar(100) NOT NULL, - `vendor` varchar(20) NOT NULL, - `image_name` varchar(100) NOT NULL, - `vnf_type` varchar(10) NOT NULL, - `vnf_id` varchar(80) NOT NULL, - PRIMARY KEY (`tenant_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VSERVER2` --- - -CREATE TABLE IF NOT EXISTS `VSERVER2` ( - `tenant_id` varchar(255) NOT NULL, - `vserver_id` varchar(128) NOT NULL, - `vserver_name` varchar(255) NOT NULL, - `vserver_name2` varchar(255) DEFAULT NULL, - `prov_status` varchar(20) DEFAULT NULL, - `selflink` varchar(255) DEFAULT NULL, - PRIMARY KEY (`tenant_id`,`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VSERVER_PSERVER` --- - -CREATE TABLE IF NOT EXISTS `VSERVER_PSERVER` ( - `vserver_id` varchar(128) NOT NULL, - `pserver_hostname` varchar(255) DEFAULT NULL, - PRIMARY KEY (`vserver_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING` --- - -CREATE TABLE IF NOT EXISTS `VVIG_VM_INSTANCE_TO_CLOUD_REGION_MAPPING` ( - `key_id` varchar(128) NOT NULL, - `cloud_region` varchar(128) NOT NULL, - `key_type` varchar(128) NOT NULL, - PRIMARY KEY (`key_id`,`cloud_region`,`key_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- --- Table structure for table `WAN_COMBO_ALLOWABLE` --- - -CREATE TABLE IF NOT EXISTS `WAN_COMBO_ALLOWABLE` ( - `combo_sequence` int(11) NOT NULL AUTO_INCREMENT, - `topology` varchar(16) DEFAULT 'unknown', - `internet_topology` varchar(20) DEFAULT NULL, - `wan1` varchar(40) DEFAULT NULL, - `wan2` varchar(40) DEFAULT NULL, - `new_start_release_flexware` varchar(16) DEFAULT 'unknown', - `is_active_flexware` varchar(1) DEFAULT 'N', - `new_start_release_dhv` varchar(16) DEFAULT 'unknown', - `is_active_dhv` varchar(1) DEFAULT 'N', - `ucpe_type` varchar(32) DEFAULT 'stand-alone', - `description` varchar(128) NOT NULL, - PRIMARY KEY (`combo_sequence`), - UNIQUE KEY `IX1_WAN_COMBO_ALLOWABLE` (`internet_topology`,`wan1`,`wan2`) -) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `DHCP_MAP` ( - `mac_addr` varchar(128) NOT NULL, - `ip_addr` varchar(128) DEFAULT NULL, - PRIMARY KEY (`mac_addr`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `RESOURCE_GROUP_TO_TARGET_NODE_MAPPING` ( - `group_uuid` varchar(255) NOT NULL, - `parent_uuid` varchar(255) NOT NULL, - `target_node_uuid` varchar(255) NOT NULL, - `target_type` varchar(255) NULL, - `table_name` varchar(255) NULL, - PRIMARY KEY (`group_uuid`, `parent_uuid`, `target_node_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - - -CREATE TABLE IF NOT EXISTS `ATTRIBUTE_VALUE_PAIR` ( - `resource_uuid` varchar(255) NOT NULL, - `attribute_name` varchar(255) NOT NULL, - `resource_type` varchar(255) NOT NULL, - `attribute_value` varchar(255) DEFAULT NULL, - `resource_customization_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`attribute_name`,`resource_type`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `COMPLEX_RESOURCE` ( - `uuid` varchar(255) NOT NULL, - `model_yaml` longblob, - `invariant_uuid` varchar(255) NOT NULL, - `customization_uuid` varchar(255) NOT NULL, - `version` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `type` varchar(255) NOT NULL, - PRIMARY KEY (`uuid`,`customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `NODE_CAPABILITY` ( - `capability_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_provider_uuid` varchar(255) NOT NULL, - `capability_provider_customization_uuid` varchar(255) NOT NULL, - `capability_name` varchar(255) DEFAULT NULL, - `capability_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`capability_id`) -) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `NODE_REQUIREMENT` ( - `requirement_id` int(11) NOT NULL AUTO_INCREMENT, - `capability_id` int(11) DEFAULT NULL, - `capability_provider_uuid` varchar(255) DEFAULT NULL, - `capability_provider_customization_uuid` varchar(255) DEFAULT NULL, - `capability_consumer_uuid` varchar(255) NOT NULL, - `capability_consumer_customization_uuid` varchar(255) NOT NULL, - `requirement_name` varchar(255) NOT NULL, - PRIMARY KEY (`requirement_id`), - KEY `NODE_REQUIREMENT_TO_NODE_CAPABILITY` (`capability_id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `RELATED_NETWORK_ROLE` ( - `network_model_customization_uuid` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`network_model_customization_uuid`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `RESOURCE_GROUP` ( - `resource_uuid` varchar(255) NOT NULL, - `group_uuid` varchar(255) NOT NULL, - `group_customization_uuid` varchar(255) DEFAULT NULL, - `group_invariant_uuid` varchar(255) NOT NULL, - `group_name` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `group_type` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`group_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `RESOURCE_POLICY` ( - `resource_uuid` varchar(255) NOT NULL, - `policy_uuid` varchar(255) NOT NULL, - `policy_customization_uuid` varchar(255) DEFAULT NULL, - `policy_invariant_uuid` varchar(255) NOT NULL, - `policy_name` varchar(255) DEFAULT NULL, - `version` varchar(255) DEFAULT NULL, - `policy_type` varchar(255) DEFAULT NULL, - `property_type` varchar(255) DEFAULT NULL, - `property_source` varchar(255) DEFAULT NULL, - `property_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`resource_uuid`,`policy_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `RESOURCE_POLICY_TO_TARGET_NODE_MAPPING` ( - `policy_uuid` varchar(255) NOT NULL, - `parent_uuid` varchar(255) NOT NULL, - `target_node_uuid` varchar(255) NOT NULL, - `target_type` varchar(255) DEFAULT NULL, - `target_node_customization_uuid` varchar(255) DEFAULT NULL, - `policy_customization_uuid` varchar(255) DEFAULT NULL, - PRIMARY KEY (`policy_uuid`,`parent_uuid`,`target_node_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - -CREATE TABLE IF NOT EXISTS `SERVICE_MODEL_TO_COMPLEX_RESOURCE_MAPPING` ( - `service_uuid` varchar(255) NOT NULL, - `complex_resource_uuid` varchar(255) NOT NULL, - `complex_resource_customization_uuid` varchar(255) NOT NULL, - PRIMARY KEY (`service_uuid`,`complex_resource_uuid`,`complex_resource_customization_uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `VFC_RELATED_NETWORK_ROLE` ( - `vfc_customization_uuid` varchar(255) NOT NULL, - `vm_type` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`vfc_customization_uuid`,`vm_type`,`network_role`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `VNF_RELATED_NETWORK_ROLE` ( - `vnf_customization_uuid` varchar(255) NOT NULL, - `network_role` varchar(255) NOT NULL, - `related_network_role` varchar(255) NOT NULL, - PRIMARY KEY (`vnf_customization_uuid`,`network_role`,`related_network_role`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - diff --git a/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java index a869249..081199c 100644 --- a/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java +++ b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/OperationsApiControllerTest.java @@ -6,6 +6,7 @@ import org.junit.runner.RunWith; import org.onap.sdnc.apps.ms.gra.core.GenericResourceMsApp; import org.onap.sdnc.apps.ms.gra.data.ConfigPreloadDataRepository; import org.onap.sdnc.apps.ms.gra.data.ConfigServicesRepository; +import org.onap.sdnc.apps.ms.gra.data.OperationalServicesRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; @@ -30,6 +31,7 @@ public class OperationsApiControllerTest { private final static String PRELOAD_NETWORK_URL = "/operations/GENERIC-RESOURCE-API:preload-network-topology-operation/"; private final static String PRELOAD_VFMODULE_URL = "/operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation/"; + private final static String SERVICE_TOPOLOGY_URL = "/operations/GENERIC-RESOURCE-API:service-topology-operation/"; @Autowired @@ -38,11 +40,19 @@ public class OperationsApiControllerTest { @Autowired ConfigPreloadDataRepository configPreloadDataRepository; + @Autowired + ConfigServicesRepository configServicesRepository; + + @Autowired + OperationalServicesRepository operationalServicesRepository; + @BeforeClass public static void setUp() throws Exception { - System.out.println("OperationsApiControllerTest: Setting serviceLogicProperties and serviceLogicDirectory"); + System.out.println("OperationsApiControllerTest: Setting serviceLogicProperties, serviceLogicDirectory and sdnc.config.dir"); System.setProperty("serviceLogicProperties", "src/test/resources/svclogic.properties"); - System.setProperty("serviceLogicDirectory", "target/docker-stage/opt/onap/sdnc/svclogic/graphs/generic-resource-api"); + System.setProperty("serviceLogicDirectory", "src/test/resources/svclogic"); + System.setProperty("sdnc.config.dir", "src/test/resources"); + } @@ -88,6 +98,31 @@ public class OperationsApiControllerTest { assertEquals(1, configPreloadDataRepository.count()); } + @Test + public void operationsGENERICRESOURCEAPIserviceTopologyOperationAssignPost() throws Exception { + + // Remove any existing service data + configServicesRepository.deleteAll(); + operationalServicesRepository.deleteAll(); + + // Add invalid content + String content = readFileContent("src/test/resources/preload1-rpc-vfmodule.json"); + MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(SERVICE_TOPOLOGY_URL).contentType(MediaType.APPLICATION_JSON).content(content)) + .andReturn(); + assertEquals(200, mvcResult.getResponse().getStatus()); + assertEquals(0, configServicesRepository.count()); + assertEquals(0, operationalServicesRepository.count()); + + // Add valid content + content = readFileContent("src/test/resources/service-assign-rpc.json"); + mvcResult = mvc.perform(MockMvcRequestBuilders.post(SERVICE_TOPOLOGY_URL).contentType(MediaType.APPLICATION_JSON).content(content)) + .andReturn(); + assertEquals(200, mvcResult.getResponse().getStatus()); + assertEquals(1, configServicesRepository.count()); + assertEquals(1, operationalServicesRepository.count()); + + } + private String readFileContent(String path) throws IOException { String content = new String(Files.readAllBytes(Paths.get(path))); return content; diff --git a/ms/generic-resource-api/src/test/resources/application.properties b/ms/generic-resource-api/src/test/resources/application.properties index 9f7990c..807719e 100644 --- a/ms/generic-resource-api/src/test/resources/application.properties +++ b/ms/generic-resource-api/src/test/resources/application.properties @@ -6,7 +6,8 @@ spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false logging.level.com.att=TRACE logging.level.org.onap=TRACE spring.datasource.url=jdbc:derby:memory:sdnctl;create=true -spring.datasource.username=sdnc +spring.datasource.platform=derby +spring.datasource.username=sdnctl spring.datasource.password=abc123 spring.datasource.driver-class-name=org.apache.derby.jdbc.EmbeddedDriver spring.datasource.testWhileIdle=true @@ -18,4 +19,4 @@ spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.Im spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl spring.jpa.database=derby serviceLogicProperties=src/test/resources/svclogic.properties -serviceLogicDirectory=target/docker-stage/opt/onap/sdnc/svclogic/graphs/generic-resource-api
\ No newline at end of file +serviceLogicDirectory=target/docker-stage/opt/onap/sdnc/svclogic/graphs/generic-resource-api diff --git a/ms/generic-resource-api/src/test/resources/data-derby.sql b/ms/generic-resource-api/src/test/resources/data-derby.sql new file mode 100644 index 0000000..68aec27 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/data-derby.sql @@ -0,0 +1,1036 @@ +INSERT INTO NETWORK_MODEL VALUES ('367a8ba9-057a-4506-b106-fbae818597c6','6794ec22-95ff-4b00-8846-b1148e90df54',NULL,'b7a1b78e-6b6b-4b36-9698-8c9530da14af','a2a57fb1-213d-45a4-acd8-6a0f7b4e54b1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + +INSERT INTO SERVICE_MODEL VALUES ('00e50cbd-ef0f-4b28-821e-f2b583752dd3',NULL,'dbf9288d-18ef-4d28-82cb-29373028f367',NULL,'vBNG_0202','Virtual','Service','Network L1-3','N','Vbng0202','service-Vbng0202-template.yml',NULL), +('0a92fd9c-baab-4c03-b4e2-827e2cb9bcc7',NULL,'083b57cd-4b76-4924-a64c-610445528063',NULL,'BK-012317-UUID-Service','BK-012317-UUID-Service','Service','Network L1-3','N','Bk012317UuidService','service-Bk012317UuidService-template.yml',NULL), +('0f9ecdcd-76b2-442e-82ec-087f054945dd',NULL,'745248d9-546b-4584-b779-9be89165968e',NULL,'vLB_CDS_test1','test1','Service','Network L1-3','Y','VlbCdsTest1','service-VlbCdsTest1-csar.csar',NULL), +('111dc790-5308-4132-9af3-5da4658cd4c8',NULL,'90541cfb-439a-4972-b2f4-ba3a0b3a2d62',NULL,'demoVFWCL','catalog service description','Service','Network L1-3','Y','Demovfwcl','service-Demovfwcl-csar.csar',NULL), +('5da7f7d1-8417-4d72-a5ba-0a2e91a83389',NULL,'71173a6b-0c71-49cf-bb26-7f2c7ab7a69a',NULL,'demoVLB_CDS','catalog service description','Service','Network L1-3','Y','DemovlbCds','service-DemovlbCds-csar.csar',NULL), +('9e252ab6-69ed-4e9a-a03d-1f31ac0eed9a',NULL,'be13ff15-5121-4394-be46-d3df5e774561',NULL,'demoVLB','catalog service description','Service','Network L1-3','Y','Demovlb','service-Demovlb-csar.csar',NULL), +('ddb4af60-bdac-4f73-b6d8-2286a4e92838',NULL,'745248d9-546b-4584-b779-9be89165968e',NULL,'vLB_CDS_test1','test1','Service','Network L1-3','Y','VlbCdsTest1','service-VlbCdsTest1-csar.csar',NULL); + +INSERT INTO VF_MODEL VALUES ('002c7b3f-2cf5-4a36-8c68-9952d258e26a',NULL,'f07ca67d-01fd-4eb7-8ed3-9ae36cc5689d','487dc954-8913-4485-9eea-17328023ae37','1.0','RG_3-17_Juniper',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0882e51b-a150-46d5-95ff-ba39e6b0e9cd',NULL,'e84297f3-b740-468b-a462-5b598218ba49','d1761fed-6c16-4ac2-a5b8-acc19345de7c','1.0','Erez-Test',NULL,NULL,1,NULL,NULL,NULL,NULL,'Erez-test','1.0'), +('0ac79616-4f69-4936-8f31-5ce982282be2',NULL,'d3f33c8f-bd9f-447d-b4d2-ad6fc5aea83f','2abcec58-fe97-478e-a58f-35c8cdc3ec3d','1.0','Tunnel_XConn for DHV Testing',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('0b70d1c0-81cd-49ff-a023-ea77ea616034',NULL,'4855e399-a5cd-4c22-96d0-72d12906a199','5f71acf1-30e5-4832-9c7b-85ec7fd4c814','1.0','RG_5-23_CSR',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('13f2e3ec-103a-433e-a7d2-e6481ad7555d',NULL,'966e9e4d-44b4-4b21-beb7-0d627e744cde','d68d5e8f-5f0c-40bf-aab4-c0526c908ca9','1.0','RG_5-12_vMOG_SDNGC',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('14db7127-331a-476a-a160-ab719ed2216a',NULL,'af94e0b5-454c-4fd8-b62b-ef27632afd22','71b87384-8e60-4d0b-9ed0-757245996fc3','1.0','VID-PCRF-05-15-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('14eadd76-73fd-4f21-b497-74ae30c112c8',NULL,'54e45ec1-0c26-419e-9406-59ea3048a9a4','d2e9a881-9c3c-4989-bbc4-3926bbfaa2f3','1.0','IXLAtest',NULL,NULL,1,NULL,NULL,NULL,NULL,'ATT','1.0'), +('16ecd2b2-8d3f-4a70-ada1-a4d5cb4a3fc4',NULL,'8ae2cd75-b3f3-4066-9565-f2d1a11776be','cd39dc66-8f81-46df-9c15-bea7cb4d45ed','4.0','VID-PCRF-031517-VSP',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('17af1f68-4cd8-4ea3-82c7-32681aa4652f',NULL,'64a1421f-8345-4221-9e8d-3b98363312ac','7b12d706-4fd3-4d57-b56e-7a4692f31968','1.0','vHSS-EPC-RDM3-Lab-VF-0921',NULL,'Y',1,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('1a6e8495-ae7f-4054-a749-274d94043b26',NULL,'c238a6ae-4ac1-4261-a022-3cb3dac69a20','e971cc83-5589-4f8d-8edf-e9d2f0e8c982','2.0','VF_zrdm5bpxtc02_092017',NULL,'Y',1,NULL,NULL,NULL,NULL,'Ericsson','1.0'), +('1e7a8782-7bf6-4726-a26e-a5e4eca6cba1',NULL,'5255679f-0d50-49e3-82f1-e51bca8cf6d1','f6d6767d-c015-4924-9052-97659f8a16e3','1.0','eNodeBALU',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'alu','123456'), +('23165057-8f27-47e9-a522-d12ed273d2f2',NULL,'d87f6943-1225-4e69-9407-72d6472d84aa','bf94dc77-0892-4be1-a66b-f2f3cc3a44cb','1.0','RG_5-23_Wanx',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('232972fe-4ee2-4056-b23a-73c5052eb791',NULL,'af94e0b5-454c-4fd8-b62b-ef27632afd22','71b87384-8e60-4d0b-9ed0-757245996fc3','1.0','VID-PCRF-05-15-17',NULL,NULL,1,'function_2','code_1','Type_1','role_1',NULL,NULL), +('28eede97-7501-4619-94a9-a683ff413f8b',NULL,'20616b93-935e-4329-85d5-bea6d2c08379','7b12aaae-68ef-4376-9663-18ee5503f8c9','1.0','RG_3-17_WANx',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2fdb7e0a-eb44-457b-a9ed-f7f83351aff3',NULL,'6b4aa415-8d03-4fcd-bef4-187c216d9f3b','66a12a1c-47ab-4921-b2f9-e8aaf4ff3af7','2.0','MOBT Nimbus 3 Sprint 1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('30bf4d55-85ae-40c1-90c3-7f2fddc1fb91',NULL,'640869f2-0e92-43c8-911f-b63022f4adf8','92c2f336-3d56-4f53-9bcc-2a1079ff682c','1.0','BK-Sanity-06-22-17-VF',NULL,NULL,1,NULL,NULL,NULL,NULL,'BK-Sanity-05-11-17','1.0'), +('31bf2df5-b35d-4823-91d0-a1d24b6a1a9b',NULL,'b94e6bb6-e5c9-4768-b4ee-1c9dc4c8c730','9e4977a8-41d7-49ec-aeb5-e1332013ed94','1.0','RG_6-22_vMOG2',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('31f3e4bf-94c2-4699-b9ff-a08d0c28eeec',NULL,'d87f6943-1225-4e69-9407-72d6472d84aa','bf94dc77-0892-4be1-a66b-f2f3cc3a44cb','1.0','RG_5-23_Wanx',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('3204e4cd-a665-4a95-b66a-bc80a6a0fabf',NULL,'944d3f67-4441-4728-aa3c-33d4109e17e9','8961a6e1-c463-40c3-9b3a-fe8c620b1189','1.0','BK-RADCOM--062117',NULL,NULL,1,NULL,NULL,NULL,NULL,'BK-Sanity-05-11-17','1.0'), +('32cc97d7-14cb-4727-8e17-ec70ed56a651',NULL,'58d838ea-e864-4a8e-9fee-bb3cc1f3f2be','4995eb33-f827-4eb1-be90-816efcad28b6','2.0','sixsix',NULL,NULL,1,NULL,NULL,NULL,NULL,'at&t','000000'), +('37f02ecf-c30f-485e-a2ae-5e81fba64003',NULL,'17bda8fa-d79b-4a0b-bcf9-b9c583fd286c','0d6dda79-c0ba-4567-8319-d3e3b6b1580e','1.0','Service_Admin for DHV Test',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('380572bc-4a89-4f4e-85f1-2c250bf0e6c8',NULL,'64f181a7-61ef-4df1-91b6-7b931b9233fd','9c351809-d899-401f-8e16-35934ad3ba71','1.0','MVM_SBC_1710_092017',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','1.0'), +('3a10db5a-378f-4fd6-a8d4-b731a4bbddf6',NULL,'af94e0b5-454c-4fd8-b62b-ef27632afd22','71b87384-8e60-4d0b-9ed0-757245996fc3','1.0','VID-PCRF-05-15-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('3dc7aa9f-ab87-4e45-94f9-bbffe52b8a22',NULL,'9c1724fd-fea1-4b74-8474-86cd1867d3bb','3bc009b9-4f40-4613-b12b-da23ce8aaaaa','2.0','BK-vBNG-1702-05-16-17',NULL,NULL,1,NULL,NULL,NULL,NULL,'141_vCPM-05-05-17','1.0'), +('3e12c838-8735-48e8-8b6e-2254370adc83',NULL,'0fcabde3-c5fd-4ebc-9c62-dad025eaca63','e750d39d-268a-4c79-8b99-894d2ead1713','2.0','RG_5-23_ContrailRoute',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('3f7bdb33-28ec-4a6b-baa2-84af2cfb5df8',NULL,'54e45ec1-0c26-419e-9406-59ea3048a9a4','d2e9a881-9c3c-4989-bbc4-3926bbfaa2f3','1.0','IXLAtest',NULL,NULL,1,NULL,NULL,NULL,NULL,'ATT','1.0'), +('3fae5e32-b3b7-4ae2-8194-00397de12415',NULL,'f023d0de-56a0-4cb4-b50b-9604808b936a','19c3d1eb-57f4-4d31-ba93-73305e0fa076','22.0','EFMC_DBE_Nin',NULL,'Y',1,NULL,NULL,NULL,NULL,'JUNIPER ','1.0'), +('47c2c5f4-1b74-4ddb-968f-d1e38e5b009a',NULL,'e02fd1cc-8b99-4121-8bd8-5f43bdfa3f43','314624ea-ba6d-45ad-856c-0576d5a202cb','2.0','Steph Preload Demo VNF mDNS',NULL,NULL,1,'Mobile DNS',NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('47d8dbb8-f8b4-4316-9303-94268037bea8',NULL,'e9726c10-ebaf-42bd-a018-1c4fe6dc5bf9','93a15c58-cf63-40df-93a2-1f3aad06e050','1.0','StellaPattern5',NULL,NULL,1,NULL,NULL,NULL,NULL,'vlmstella_scp','1.0'), +('4b50c49f-678a-4a80-bca1-b93b6699c29f',NULL,'cc951666-5573-4c5c-8a2f-aed6b24c51a7','1da6a669-c0a6-4f06-ab6a-71df8d2a38de','1.0','RG_5-23_Juniper',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('4c462123-73ba-49fc-a0d1-ab3db4206d2e',NULL,'8fe74968-dd22-4714-9e85-0f251c666f83','b66f10b4-9c56-4fb2-adf9-8252fa769a40','1.0','VSP1707061',NULL,NULL,1,NULL,NULL,NULL,NULL,'VLM1707061','1.0'), +('4f2c3850-0e53-4c8d-91e1-ab0f41858b3b',NULL,'4eff900a-9783-4cfd-ba06-b3c969248c98','c4c962e6-f0b6-45c5-936c-0c737e4ce431','1.0','BK-Performance',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('4f522401-b61f-44af-a7ae-de55516d4c6c',NULL,'4855e399-a5cd-4c22-96d0-72d12906a199','5f71acf1-30e5-4832-9c7b-85ec7fd4c814','1.0','RG_5-23_CSR',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('4f90bfae-b0de-4764-9049-759ea90fd11d',NULL,'5e2be8e3-4ccc-4add-85b4-7cd0a4e70176','4935c10f-dca9-4f72-9f71-3e224c092b5e','2.0','MOW_ADIG_VPE_BV',NULL,'Y',1,NULL,NULL,NULL,NULL,'Juniper valid 2','1.0'), +('55445025-028e-4b5f-8e59-3fc71b140c7c',NULL,'b94e6bb6-e5c9-4768-b4ee-1c9dc4c8c730','9e4977a8-41d7-49ec-aeb5-e1332013ed94','1.0','RG_6-22_vMOG2',NULL,NULL,1,'Mobility Orchestration Gateway (MOG)','MOGX','Application','vMOG','RG_3-15-_VLM','1.0'), +('56179cd8-de4a-4c38-919b-bbc4452d2d73',NULL,'e8edfda2-a9d2-422d-a49c-32cad3d19d5a','8eb949d6-9635-426c-9f70-7edb4c1d5cc8','1.0','FDNT',NULL,NULL,2,'some nf funcion','some code','some nf type','some nf role','ciLicense2a511793','1.0'), +('562d03ac-d59c-4ee8-8f96-b9b36aa7c889',NULL,'68ed6ecf-37cd-4480-9338-15d847b26a55','aefb8cc8-b44b-432e-9569-58ee9401de9e','1.0','RG_5-23_Fortinet',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('5907fbd1-8744-4b5a-885e-a42fdf0a299a',NULL,'b94e6bb6-e5c9-4768-b4ee-1c9dc4c8c730','368a1605-cb2e-4bc2-b4ce-ca47edf7ebbf','2.0','RG_6-22_vMOG2',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('5ade5817-4749-4f33-86b0-a8ef8672e4e8',NULL,'d149c45a-b42f-419a-9fac-f9c359fc2034','3b25707a-d345-4a80-8744-73adf8f2e67b','3.0','greatdefect',NULL,NULL,1,NULL,NULL,NULL,NULL,'ATT','1.0'), +('5d45dd21-8a7d-4e90-8d77-6f28717de199',NULL,'2a08c64c-9520-4945-a8af-4cbd70a756d9','5ac5647e-bd70-487c-8cb4-aa3ef0733c33','1.0','2016-20-vISBC3VF',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','1.0'), +('5e18b3bb-1072-40f1-baf2-36742edcfc93',NULL,'573ef755-d774-410b-ad73-5789ba779cdb','3fa8d519-7f9f-4ac9-9e43-74597ab91e19','1.0','RG_vMOG_5-15_VSP',NULL,NULL,1,'function','code','type','role',NULL,NULL), +('5ee69e8a-f8f3-41dd-a590-a1d7ae9f5796',NULL,'9c1724fd-fea1-4b74-8474-86cd1867d3bb','1ddcf9c9-522f-4ce6-a92d-f6442edb42be','1.0','BK-vBNG-1702-05-16-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('635d73cb-baf6-42e7-9ae4-ac44e6344105',NULL,'d149c45a-b42f-419a-9fac-f9c359fc2034','6342a6fc-0c83-40d9-8a29-d14332731088','2.0','greatdefect',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('64b23494-215e-48b1-a868-746fa3922679',NULL,'7bc3ea49-c529-42fa-b396-149913d4948e','54707a5f-5e63-4e06-8874-64a67b56b032','3.0','FN vProbe BE 11 2 5 1 VF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'RADCOM','1.0'), +('65962e6a-2ec4-405b-8b5c-b59c8600c119',NULL,'887ba3f3-4895-4a07-9fca-2f85eae2197d','2d40b8a0-6a42-4f55-9ef4-89f50f0816b7','2.0','2016-73_MOW-AVPN-vPE-BV-L',NULL,'Y',1,NULL,NULL,NULL,NULL,'Juniper valid 2','1.0'), +('666601b2-f193-4543-847c-92b217da64de',NULL,'a9e8acb6-aa6b-42f0-a708-1e345f848b41','1c38215b-c380-43be-b7a1-3c98bfe0d067','1.0','Testlatest1710VSP',NULL,'Y',1,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('67db60f5-6818-4baf-ac5a-e5d00f83b916',NULL,'9eb25d67-2482-4647-aca5-08b1136cbd40','9625ab00-53c0-44cb-a661-093a5145eb68','1.0','6i6qHMWC66bXeYG0n73M1',NULL,NULL,1,NULL,NULL,NULL,NULL,'9qP6cJXAwbEN4Dod5FIK1','1'), +('698e68c4-2f63-4280-93fa-32abedb0c9b1',NULL,'54e45ec1-0c26-419e-9406-59ea3048a9a4','1d71d759-5218-4a9c-a74d-d9f2e1e41624','2.0','IXLAtest','nf.naming',NULL,1,'Ixia Ixload for end-2-end SUT','nf,code','Test Tool','vTools','ATT','1.0'), +('6d83dd0e-5f47-4199-95fe-c8f05739c954',NULL,'8c27db30-3417-4310-8cca-739033e16528','25ed9038-5d0d-4d58-8028-21a380fc4909','1.0','VSP_new1',NULL,NULL,1,NULL,NULL,NULL,NULL,'VLM_new1','1.0'), +('70279afc-93ed-4c05-bacb-38c06ddf253d',NULL,'76092c54-24e1-4757-b404-c165db98f011','4f048a9d-5b51-4b46-8736-a62b9ae6592d','1.0','RG_3-17_vCSR',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('77854203-788f-4459-b217-decfa65d8b65',NULL,'04e561a8-16dd-43e9-867a-21431ed94c88','2abc9f02-613f-421e-8d5c-f7fed056480c','1.0','MNSOAM DEMO',NULL,'Y',1,NULL,NULL,NULL,NULL,'ATTSa997j','1.0'), +('7b37efd4-15b4-4744-a477-06784f21d5f7',NULL,'06ed3d2e-aaeb-4529-a87d-658301a95436','83d5ee29-0d9d-4f4e-bbe7-39e117fb84b6','5.0','VF-SSC-vISBC-APPC-Config',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','v1.0'), +('8027ed9d-44c7-4bcb-ad2c-902fe50e8a4b',NULL,'8ae2cd75-b3f3-4066-9565-f2d1a11776be','1c31fc16-f8da-45a6-b05f-76ae36cee911','3.0','VID-PCRF-031517-VSP',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('80fac977-55b1-460e-934d-ffe6055d67e2',NULL,'6b4aa415-8d03-4fcd-bef4-187c216d9f3b','10a4a71a-d7d7-4355-9877-3034d7bfd50f','1.0','MOBT Nimbus 3 Sprint 1',NULL,'Y',1,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('819ef122-ca19-4141-a61e-62922f8fc279',NULL,NULL,'ff2ae348-214a-11e7-93ae-92361f002673','version','name',NULL,'Y',0,'nf-function-1','nf-code-1','nf-type-1','nf-role-1',NULL,NULL), +('81c06d59-f43c-4757-8f6c-f04599f328ab',NULL,'bc3622d2-a645-4806-80f2-96b04a866bbf','3f283439-4e0e-4a6a-9b31-da5d0cb05b52','1.0','29NFOD',NULL,NULL,1,NULL,NULL,NULL,NULL,'29NFOD','29NFOD'), +('84ced91f-34b9-4769-8238-524cccc66538',NULL,'054a06cc-7713-4d51-a3ca-51e2ce4585ba','507ab4a9-bd83-4806-bf2f-03e84b494807','1.0','vVIG_AIC-05-22-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('87743f2b-dba0-49bf-b035-4f2a35502bd3',NULL,'06ed3d2e-aaeb-4529-a87d-658301a95436','ca554a79-3b62-4fd6-aa17-e79555df3a3e','4.0','VF-SSC-vISBC-APPC-Config',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','v1.0'), +('88122b3f-a72a-4fa9-ad31-dbb102d13051',NULL,'b0d77932-dadd-4bde-82c9-0bcc367cb81c','ce7f92a3-d5a8-4830-b1f9-72d32ff0f2bc','1.0','Dev2DevIpAssign_24_07','Dev2DevVfNamingPolicy','Y',1,'Dev2DevNfFunction','Dev2DevNfNamingCode','Dev2DevNfType','Dev2DevNfRole','Cisco','1.0'), +('8a2c15b4-9817-414c-8cab-c672d4bd47ac',NULL,'66ca7353-09a9-4caf-aee2-707ce2d53581','7f1fe626-fe0d-4372-ba52-5482e2825c63','24.0','2016-233_XSP-bfsa',NULL,'Y',1,NULL,NULL,NULL,NULL,'Broadsoft','1.0'), +('8a93cf8f-525c-4614-a0a7-4c0cd299f42a',NULL,'2f52d9f5-8526-42ea-9aa8-2accca7a34d3','8a7a3a5d-172d-4758-aba5-56c59f7eb239','1.0','vsp522vmog',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('8b02496d-19ef-4de0-b1d9-2a363906bd33',NULL,'447a938d-7441-470b-9803-dc629375a243','3c46d08c-1476-43bb-9367-0c6221dceaf6','1.0','2017-505_URLB-vHEPE',NULL,'Y',1,NULL,NULL,NULL,NULL,'Juniper valid 2','1.0'), +('8b59666c-9b22-435c-98a6-1523603c428f',NULL,'892bf8ec-3e3a-4352-9a6d-c3d870740fbb','e0721c47-ce3b-4384-adc5-64fee3aadb2e','1.0','RG_3-17_Fortinet',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8bc9d4ba-1773-416f-a89b-10b00345ea9a',NULL,'bb1726db-9c23-459c-9ea5-a36f3d7a58df','5b309afc-7b11-4085-a20b-8d1c7b622824','2.0','RG_5-23_LalenaVF',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('8e521171-9096-4d76-b311-c37e56bab26c',NULL,'89ecd794-f7cc-436d-a072-bf394baffba2','a0f92cd7-1a27-4aa7-95b4-0469e2fb655e','1.0','RG_6-9_vMOG',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('8e754bf1-b24e-4b4a-abf3-70f3bdc3e12d',NULL,'17bda8fa-d79b-4a0b-bcf9-b9c583fd286c','0d6dda79-c0ba-4567-8319-d3e3b6b1580e','1.0','Service_Admin for DHV Test',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('90932810-f844-4a42-86a2-4008bf8d2e56',NULL,'c0fe7298-c934-4133-8de1-ee795d0e74c5','96728f9e-075d-4ea8-8ac8-7967438c2d70','1.0','BK-vIRC_CC-06-21-17-VF',NULL,NULL,1,NULL,NULL,NULL,NULL,'BK-Sanity-05-11-17','1.0'), +('9242722b-cfb9-4e1c-923a-08874d8074ae',NULL,'e02fd1cc-8b99-4121-8bd8-5f43bdfa3f43','314624ea-ba6d-45ad-856c-0576d5a202cb','2.0','Steph Preload Demo VNF mDNS',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('97b8bc8d-3908-4501-9500-3aa28c970dcd',NULL,'3b11547b-05b1-4bbf-b814-39b22d46034f','47e3efc4-3fa4-4b43-b891-0fb382b09b26','1.0','BK-03-22-17-VSP',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'BK-03-22-17','1.0'), +('98874aff-d866-426e-bdcb-959790defb50',NULL,'f8d79f0a-b7e1-4972-9c49-0f0965d44f96','b0938785-0295-455d-ad1b-d918de50163e','2.0','201712-488_ADIOD-vPE',NULL,'Y',1,NULL,NULL,NULL,NULL,'Juniper valid 2','1.0'), +('9c748db1-e54a-4994-9c64-44076eb2ad49',NULL,'af94e0b5-454c-4fd8-b62b-ef27632afd22','71b87384-8e60-4d0b-9ed0-757245996fc3','1.0','VID-PCRF-05-15-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('9f8dbc4f-d7f6-421b-a2fe-3c09b1068622',NULL,'b8064c7c-2390-4eab-9472-f0cdde3b1b9e','1bba1911-e393-46fb-a773-a93d29261cc2','1.0','IP_Mux_Demux updated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('a14da74c-b969-4b77-a6dd-9e4d4e421987',NULL,'d464cc8a-d950-4a7f-b80f-80b476d8d78b','0456ad99-357f-4bac-98b5-36cada7bc5a6','1.0','BK-MCR_Linbit_30-062117',NULL,NULL,1,NULL,NULL,NULL,NULL,'BK-Sanity-05-11-17','1.0'), +('a432ada6-def2-41bb-ac56-d52e0d97c28c',NULL,'fd889284-c83a-4212-9392-466ef4a8dc22','92de75bf-d4d5-44e5-a4e3-20a37efb3141','1.0','RG_vBNG_VSP',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('a461cf24-d9c3-4c17-9442-7d2e79e6b2a0',NULL,'66ca7353-09a9-4caf-aee2-707ce2d53581','93348147-d20e-4621-a63e-74598559d83d','22.0','2016-233_XSP-bfsa',NULL,'Y',1,NULL,NULL,NULL,NULL,'Broadsoft','1.0'), +('a5e940bc-07f2-47f9-8a8d-818e12c4f6eb',NULL,'66ca7353-09a9-4caf-aee2-707ce2d53581','59f22ce9-66d7-41c5-873c-8a56f5e0e592','20.0','2016-233_XSP-bfsa',NULL,'Y',1,NULL,NULL,NULL,NULL,'Broadsoft','1.0'), +('acc15553-e8fa-41f1-a260-e4588290dd9d',NULL,'b8064c7c-2390-4eab-9472-f0cdde3b1b9e','1bba1911-e393-46fb-a773-a93d29261cc2','1.0','IP_Mux_Demux updated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('ad07a460-4224-4b55-8aab-cbd3d3c3310b',NULL,'b5bbf19a-9fed-4fc0-a61e-e44d246f37b8','f59db7f5-74fb-4dbd-94aa-90b2ce4ac627','3.0','Metrocell',NULL,'Y',1,NULL,NULL,NULL,NULL,'yow','123556'), +('b68b482a-fee0-4477-85dd-d6f935cdad7c',NULL,'c238a6ae-4ac1-4261-a022-3cb3dac69a20','75aa4aa7-43e2-40a8-a01d-40a743397614','1.0','VF_zrdm5bpxtc02_092017',NULL,'Y',1,NULL,NULL,NULL,NULL,'Ericsson','1.0'), +('b73d7c17-cd17-4ee1-a74b-cacf560e5b6d',NULL,'bfa5b434-b040-411d-a42d-0d7cd89ff929','1d7eb27f-f64c-4977-b877-b7024301ecb4','1.0','demo for Ops',NULL,'Y',1,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('bb50f135-22d2-4b64-98ab-e6aed28608e8',NULL,'d3f33c8f-bd9f-447d-b4d2-ad6fc5aea83f','2abcec58-fe97-478e-a58f-35c8cdc3ec3d','1.0','Tunnel_XConn for DHV Testing',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'AT&T','0'), +('bb6e7a13-45db-423e-b368-46f9592bcb87',NULL,'cc951666-5573-4c5c-8a2f-aed6b24c51a7','1da6a669-c0a6-4f06-ab6a-71df8d2a38de','1.0','RG_5-23_Juniper',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('bcfb218c-dd25-4757-8835-1bbabb2b547f',NULL,'6e5c68a4-8479-4609-9d9b-088b36d209c3','3e7f714b-d3a4-4fec-8cce-e5de75b42f6c','1.0','vHSS-Test-NR2989-VF',NULL,'Y',1,NULL,NULL,NULL,NULL,'Mobility Vendor','1.0'), +('c00e8fc8-af39-4da8-8c78-a7efc2fe5994',NULL,'1fb1d956-406b-4610-9edf-d31086ba851c','76e908e0-5201-44d2-a3e2-9e6128d05820','3.0','mDNS preload 1710 0914',NULL,'Y',1,'Mobile DNS','MDNS','DNS','vMobileDNS','Mobility Vendor','1.0'), +('c297ad0c-cace-41a8-ab70-ed097d75ea37',NULL,'2a08c64c-9520-4945-a8af-4cbd70a756d9','5ac5647e-bd70-487c-8cb4-aa3ef0733c33','1.0','2016-20-vISBC3VF',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','1.0'), +('c3f3fc76-99b4-4949-8e92-dcf5e8991c3a',NULL,'6e801086-7877-4f23-b8d3-7f4c1d4fc0ff','972441ce-f595-4c10-8970-5b1b06856b3e','1.0','scpStella1',NULL,NULL,1,NULL,NULL,NULL,NULL,'vlmstella_scp','1.0'), +('c9d54f0d-629f-4a4a-bc18-2798b77f48eb',NULL,'99d1438f-aabd-44dc-916a-8d89e4efd84f','b89e7723-9767-4814-b70f-fe9ba807ba72','1.0','newrelease61',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('cac83d34-7de0-430c-ac29-8bd95e043dcb',NULL,'b0b3c52b-7499-43f8-b458-ed2301f5392b','df26353a-dd3f-426b-901f-6919cba813b2','1.0','VSP1707050',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('d14ab960-72cb-44e9-896b-94578ba42361',NULL,'2f52d9f5-8526-42ea-9aa8-2accca7a34d3','8a7a3a5d-172d-4758-aba5-56c59f7eb239','1.0','vsp522vmog',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('d24a4fc7-4cec-4560-8b51-300a7faf5ea3',NULL,'e59988ce-3d81-4e07-81b5-53d3aa821134','64f2e078-bc0e-4917-b428-3ec414b6144c','8.0','vHNF for DHV Test',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Velocloud','1.0'), +('d570a67f-53fe-4df7-b214-c991e2047521',NULL,'5be7e99e-8eb2-4d97-be63-8081ff3cd10e','2074a53a-3d25-4de7-82a9-24fabe329f65','2.0','2017-488_ADIOD-vPE',NULL,'Y',1,NULL,NULL,NULL,NULL,'Juiper','1.0'), +('d5dfbb82-e303-4790-b97f-7d71c24777e6',NULL,'ce39321e-efa0-44f2-8e52-5f918435bdbb','611c9db8-ee30-4318-81c8-ebdc930eeba0','3.0','2016-234_NFM-bfnm VF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Broadsoft','1.0'), +('d747147f-cde3-43c5-ae1c-752e6bb9b84f',NULL,'54e45ec1-0c26-419e-9406-59ea3048a9a4','1d71d759-5218-4a9c-a74d-d9f2e1e41624','2.0','IXLAtest',NULL,NULL,1,NULL,NULL,NULL,NULL,'ATT','1.0'), +('dac03908-adc2-46b1-b6c8-e0de28a6a386',NULL,'640869f2-0e92-43c8-911f-b63022f4adf8','92c2f336-3d56-4f53-9bcc-2a1079ff682c','1.0','BK-Sanity-06-22-17-VF',NULL,NULL,1,NULL,NULL,NULL,NULL,'BK-Sanity-05-11-17','1.0'), +('deaa6843-204e-432b-bd46-fb4686a919cc',NULL,'06ed3d2e-aaeb-4529-a87d-658301a95436','703cb205-1feb-47bc-954c-bceb370c89f4','1.0','VF-SSC-vISBC-APPC-Config',NULL,'Y',1,NULL,NULL,NULL,NULL,'Metaswitch','v1.0'), +('e2d8605e-c4d2-46f0-b47b-d8b883890292',NULL,'68ed6ecf-37cd-4480-9338-15d847b26a55','aefb8cc8-b44b-432e-9569-58ee9401de9e','1.0','RG_5-23_Fortinet',NULL,NULL,1,NULL,NULL,NULL,NULL,'RG_3-15-_VLM','1.0'), +('e7bb3a75-450d-4b9e-bb30-858d876c8276',NULL,'0a2b2eda-59b6-40b5-b7eb-233338209994','1cfb9dae-8415-4d5c-afbe-6e8d039e580b','1.0','StellapatterC2B1',NULL,NULL,1,NULL,NULL,NULL,NULL,'vlmstella_scp','1.0'), +('efbfb008-2be0-42c6-b767-dea29209ba6d',NULL,'af94e0b5-454c-4fd8-b62b-ef27632afd22','71b87384-8e60-4d0b-9ed0-757245996fc3','1.0','VID-PCRF-05-15-17',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('f0fbdfed-19bd-4e96-9b71-d67284d39b1a',NULL,'8e823d60-8012-444e-b5ed-286fbe963e4c','f8e2d9b2-fd10-4aa1-bf72-64f0eff76988','1.0','RG_5-16_vMMSC_VSP',NULL,NULL,1,'AIC VMMSC FUNCTION','one.two.three','New Type for VMMSC','NETWORK INSTANTIATION',NULL,NULL), +('f13bb862-d588-4a96-89d0-999daf975f4b',NULL,'03c969e1-4b5b-4789-af76-07c942ebfdf3','8dd1682a-e6dd-4844-85b0-25791825b252','1.0','BK-Sanity-1707.0.22-0414',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'vCCF_VDB_30_1702','1.0'), +('f66a5a6a-30f4-40ef-a3b6-ba779a522fd0',NULL,'5d623af7-1ae4-4e7d-933b-b09bd4407f40','dac644a3-2b2c-4586-862d-9a9a4b1eb5e1','1.0','eNodeBEricssion',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ericsson','123456'), +('f79e095b-adfe-47b1-a05f-e0cc8907ab44',NULL,'54e45ec1-0c26-419e-9406-59ea3048a9a4','d2e9a881-9c3c-4989-bbc4-3926bbfaa2f3','1.0','IXLAtest',NULL,NULL,1,NULL,NULL,NULL,NULL,'ATT','1.0'), +('f9a0f22e-05ea-470a-9ffa-b63115ba9c46',NULL,'18de43f1-7634-4024-b0f7-8c8706d018dd','b948edc7-e144-4af8-b544-42bad526c2b1','1.0','VSPvscpSTELLA23mAY',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('fdebb591-644f-4682-be51-5dcdda996809',NULL,'f2cf2ec6-e2ae-4516-a52e-b909575c2e24','3a5bb746-5488-4f5a-a5b0-ea1cdae57d6a','5.0','2017-404_vUSP_vCCF_AIC3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Nokia','1.0'), +('feb18ca1-9351-45ff-aee3-8aed97d76bf2',NULL,'d149c45a-b42f-419a-9fac-f9c359fc2034','4a47b924-f4aa-4766-b508-7d8047c1ca37','1.0','greatdefect',NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL), +('fff8e2d0-9fb4-4ade-8754-e2cbcfb90947',NULL,'356f8e22-2885-4697-af27-22a223aa34cd','4846ea44-b4bc-43ae-8899-3b78a5b8f593','1.0','VF_zrdm5bpxmc02_092017',NULL,'Y',1,NULL,NULL,NULL,NULL,'Ericsson','1.0'); + +INSERT INTO VF_MODULE_MODEL VALUES ('017446e0-2014-4862-b589-9858eacce22a',NULL,'b3ae6092-1973-495b-9cae-5813679da421','e018151b-6c29-496b-92de-cd22671651d7','1','Expansion',NULL,NULL), +('021fb262-bf56-4e49-ad28-0733dc165bdc',NULL,'8cfa1617-e502-4488-b660-eccac5d81858','beda9e8c-c268-47b0-ad13-cf6dd6ea8566','3','Expansion',NULL,NULL), +('02217de7-bdd3-4dcc-9925-2734247f364f',NULL,'fbf41f6a-5405-459b-a320-12f4786258b6','e218e4e7-5780-4b12-b14c-37cbc90902bf','1','Expansion',NULL,NULL), +('0484e2af-2fed-4e92-bf15-6aaec0d1ef62',NULL,'e9924b21-0c4c-4259-9bee-c86944c8f57f','b1929aa2-f2b8-449f-bdc4-319e7b2381eb','1','Expansion',NULL,NULL), +('04be6237-6dfc-4bbb-871e-19a6708ad077',NULL,'3ff02b4e-494f-4c28-9e7c-812a6fb36106','e2f7e1e0-5789-4497-a4cd-6198b8a286f5','3','Expansion',NULL,NULL), +('055d1e23-961d-41c9-984b-caa2c41e48ba',NULL,'2fb28e79-e6f2-4cdd-832d-f191244207e5','04854ad3-6b53-4f04-a14a-6f68a839b62c','1','Expansion',NULL,NULL), +('0658eace-5459-427a-82e5-c2485f794f85',NULL,'226e457e-1bfc-4be4-8032-2569772d9563','93fa2549-bccf-40b0-88be-4fab6c1fcd24','1','Base',NULL,NULL), +('06c7d519-6271-479e-aa0e-6727a0cbf178',NULL,'70196b5b-1070-4ccc-9b7f-340f18c10424','bac518a1-0cd5-4322-8b7f-926cc49c611b','2','Expansion',NULL,NULL), +('074fc145-9dfc-4e79-b063-95a28c00b307',NULL,'8daa5c4b-a7ce-437a-9b07-5e677da342f5','9ad9fb7b-fe6e-4142-a8db-bbd90138b558','3','Expansion',NULL,NULL), +('0756874e-d137-4820-abdd-710d9035b472',NULL,'2541114d-c9c7-4281-b0eb-22e48eeed7e9','a682725a-5e77-412a-95ff-385d1be6576f','1','Expansion',NULL,NULL), +('083877a9-a5d1-4fc3-acb3-f3e11f320a27',NULL,'0cb38db9-e2f0-46e8-8c6e-a375784760b7','bcd0b7d2-668d-4159-97f2-47c299e3bcbd','1','Expansion',NULL,NULL), +('09381cfb-579c-4d8d-95ea-89d1300f0c18',NULL,'aa8a1258-9da5-4e67-aa83-0b3eb99d1ef4','ab2b410d-f871-4c6d-86af-113a4e7fc9ad','5','Base',NULL,NULL), +('097c7ed5-15b9-4f0d-9cae-2bf2d0aa16a5',NULL,'1bc5228a-4f92-4f1e-b7e8-20462a13e34b','a08da318-e1a0-45b5-a1af-86ab189dc599','1','Expansion',NULL,NULL), +('0ccc5b99-ab89-4aba-9780-a10d20a35755',NULL,'34863ff7-e24c-4b38-b7db-0b403aead85e','cd170c8d-2dd3-4029-bbd7-81bc0fc51478','9','Base',NULL,NULL), +('0d060add-6184-4ffc-bf32-50674315cb5a',NULL,'b111a6c9-1316-4133-b9ec-3be90e84afdf','4cf7e6f4-c748-490c-be04-67cd9b67d215','1','Base',NULL,NULL), +('0d6799b5-044b-491c-9b2d-5b6b40168300',NULL,'55b9e2fe-7bb0-405f-af8f-89db1b1ccab8','104743d6-f21d-46e6-95f9-a8397fd668c4','2','Expansion',NULL,NULL), +('0dc375de-8470-4b06-95d6-dc9ff0e6e590',NULL,'eb5a1e09-7f46-4f1c-ab7a-b017bad95261','fa1c8558-006c-4fb6-82f2-4fc0646d6b06','1','Expansion',NULL,NULL), +('0ecb9d84-aa21-4656-9783-655f926f7714',NULL,'8cef0a5e-ebc0-4222-afdf-b78a5a0b2f64','706cf476-acd6-4f17-bae8-646deaad9193','2','Base',NULL,NULL), +('1093265b-a5fd-482e-8c75-aabce120195e',NULL,'b3c3a78b-a4c7-4471-9929-5a57706c0776','ee245e56-794a-4a71-9c82-98e500c4a2bd','1','Expansion',NULL,NULL), +('111548bc-5fe7-4177-8049-ac492230abe0',NULL,'7fc372e2-e701-4e41-9ed6-f632bd079fe7','7f9dcff2-f6e9-40e8-895e-8b4401c0c3b3','3','Base',NULL,NULL), +('12ec65ab-e040-487d-bc7d-2ad59d3c3f3d',NULL,'b34833bb-6aa9-4ad6-a831-70b06367a091','0339846b-758d-4ce3-be04-353234d603e6','4','Base',NULL,NULL), +('135f283d-d53a-4db9-acfa-481364db46b8',NULL,'c4c106d8-eed0-4abc-b385-78a59722d4d4','8115980c-9e60-4c0d-9926-90a16b36b77f','3','Base',NULL,NULL), +('1745f7c5-4d0b-429a-bb99-2d489022fc93',NULL,'7cb28ebf-92a2-4d2e-9b8a-78fe56e0013e','7413879d-f7da-42ae-9474-1e47c99e8140','2','Expansion',NULL,NULL), +('1768d2c1-6e65-49ea-b5a3-e220cbd5b5d7',NULL,'39f1a361-7cc9-4542-bce4-17d1043a6a29','247ec87c-bd08-4b1e-affc-2f6ddb3ad45e','1','Base',NULL,NULL), +('18444f87-e820-4ab8-add5-7880a7b85d2c',NULL,'732abc4a-35ec-4e2c-b33b-835771cbaa7f','f075292e-355b-4a40-b352-3d44776d2338','2','Expansion',NULL,NULL), +('199e4140-1e9c-44fd-a05c-d9b273b3900e',NULL,'ef49b484-89da-42ab-bc2a-8f2245f8c39d','541a70eb-4361-4534-918f-da330ed98fba','2','Expansion',NULL,NULL), +('1b065adf-8f65-4d6c-a8d2-7a973bed9987',NULL,'6de0109b-082a-47d3-8773-e27086ab7154','2d4f5892-ab66-47c3-9790-d60542a6b4e1','1','Expansion',NULL,NULL), +('1b46e413-bc77-467b-ae5a-67fb653045a3',NULL,'c1d7b9fb-5948-49d8-937d-f64a7006b552','62e53e0b-785a-4535-ba07-9ffb047d2057','2','Base',NULL,NULL), +('1d11df8e-fd73-466c-b09f-448a8baf56ca',NULL,'2541114d-c9c7-4281-b0eb-22e48eeed7e9','a682725a-5e77-412a-95ff-385d1be6576f','1','Expansion',NULL,NULL), +('21262e67-15c7-4c2b-821e-98298f2cde14',NULL,'fed07b93-214d-4bfe-a0ad-0b85c37ccfbc','f4886bfc-4b78-4f5c-992c-00a7fe203937','3','Expansion',NULL,NULL), +('22025200-6a0e-44fe-abf6-2e637abffd00',NULL,'f45aa352-8e76-4ae6-adc1-340c953221ed','75eed7df-995e-4775-8bff-9cbd3bd2d35f','11','Base',NULL,NULL), +('260d1efe-e4c6-4a24-b2e2-40ba3dd85661',NULL,'b3ae6092-1973-495b-9cae-5813679da421','e018151b-6c29-496b-92de-cd22671651d7','1','Expansion',NULL,NULL), +('2618b64c-2ce7-4d97-b417-8168787e7e1a',NULL,'4b51dd2e-517c-431f-8614-75e25607c5f2','6cd0d727-f841-41e9-9ce9-128687b03f1a','2','Base',NULL,NULL), +('26868d55-4bc5-4db7-8315-eab1dbfa417e',NULL,'b9a25c01-4f84-4e19-a27e-35ea68af2c24','4e41b216-be98-4bb5-89ab-fb6d48bdb457','3','Expansion',NULL,NULL), +('276a98b8-a013-49f2-908c-96fcce3450a7',NULL,'23befc6e-aa97-4004-b215-4979c3f84913','dea8e41f-c996-4557-b521-263210d96baa','3','Expansion',NULL,NULL), +('2b52ca3b-9c4b-4c03-958c-577b52b27136',NULL,'eb5a1e09-7f46-4f1c-ab7a-b017bad95261','fa1c8558-006c-4fb6-82f2-4fc0646d6b06','1','Expansion',NULL,NULL), +('2c89166d-7ea5-4d92-a708-70812d72270f',NULL,'9b82936a-8fb0-492c-8517-f3f13e224577','6c294358-6111-42d6-b418-41225ff201cd','2','Base',NULL,NULL), +('2d207fc0-79d3-4ee1-96e1-1cef729a926e',NULL,'7cb28ebf-92a2-4d2e-9b8a-78fe56e0013e','10955ab2-c2f4-4dbf-a772-970304aa4e95','1','Expansion',NULL,NULL), +('2db2a875-529e-48d1-8be5-48280092875c',NULL,'e02deae0-d62d-408c-838c-4c9da3441d62','93c33147-3d3c-42ef-8afa-0a25230f3765','3','Expansion',NULL,NULL), +('2f3ce7ca-aec6-46c3-aaf6-9f299e88e1bb',NULL,'46576fb9-cb8c-437f-a2a6-35c84c69c4a9','d7a3666a-351b-4d2f-81d8-be78daf22c73','3','Expansion',NULL,NULL), +('319e3a65-8ae4-49cc-b3c1-5de2b4916b15',NULL,'5f52df4a-4933-4f28-9add-eb3140e08c78','20285da4-127d-45fc-9482-ea26a6888626','2','Expansion',NULL,NULL), +('3331497a-b2d7-4f1b-b53f-77dbfc157a24',NULL,'9d41a84f-d1d8-48fe-a484-ea7212a1e0c5','8e49bb50-e727-4b80-9535-c5af4a2e7708','1','Expansion',NULL,NULL), +('333a917e-d8b8-45a5-b19d-f0a6a5ce51bc',NULL,'78731de4-b9b9-4e1e-b2c7-32ecf5c28ef5','8cf80cf4-d7a1-4fd5-b936-a51b65a21333','1','Base',NULL,NULL), +('334bcdc2-0831-4a7f-95c7-7e57fc3a0ab6',NULL,'55b9e2fe-7bb0-405f-af8f-89db1b1ccab8','104743d6-f21d-46e6-95f9-a8397fd668c4','2','Expansion',NULL,NULL), +('33c58f68-ad4c-46ae-aa72-cac0c589393e',NULL,'573ed63c-3017-44a5-9bb1-f60cd54e3564','f8c3258f-4537-4e65-a06d-acfbbaf72ef3','1','Base',NULL,NULL), +('34b984b7-231a-4b56-9d49-672d44bb81ce',NULL,'d139bd94-ab51-4274-a41b-2a34d2f497af','34c2afed-7618-4163-ae92-ce730fc2e492','2','Expansion',NULL,NULL), +('366ac080-5904-406b-b827-70a63bea3b58',NULL,'7e2402f7-411d-4978-b92c-680d426d4dd0','0755192a-fd92-45f9-b531-7b257c1a5552','1','Expansion',NULL,NULL), +('3766e0cd-469c-4015-a7d1-70afd02d41ce',NULL,'3828904e-684e-4c7c-ae30-5555bac3ed38','eaf22e74-296b-4719-9705-0d17d19b6d0a','1','Expansion',NULL,NULL), +('37da548b-18ec-4599-bdd6-2f175c90b2ac',NULL,'a06628a8-2d2b-4377-8419-e8e229694437','d9027d32-d4ec-40fb-a8d3-f7afba94941f','5','Base',NULL,NULL), +('37da6c6d-a3b9-49e1-b209-f65866481344',NULL,'10d8cbe1-e9b9-4498-8c0a-9d2a1aad2e6d','8902f4d9-a018-4dca-94a8-f758bc29b6ff','3','Expansion',NULL,NULL), +('38ebbf63-72b4-47dd-be52-7fc8df9bb59e',NULL,'7199aba6-a1ee-4af6-80a4-145093b816ef','36b284ca-720a-4d35-8a7a-1846a5f5d6bf','2','Expansion',NULL,NULL), +('39ab1f47-c0fa-4c6c-8f50-15d98b315342',NULL,'4b7ae7d3-95b4-415d-95cd-28018914c2b8','0e0bffe0-922d-42d2-a154-c1a0ff762bb2','1','Expansion',NULL,NULL), +('39e0a574-c0f9-4e6d-9522-7e81afd89a66',NULL,'53392901-3530-4022-9450-5ab1501235c4','e7b801c8-cd1b-420d-9cda-3cd1f90137eb','1','Base',NULL,NULL), +('39f77bef-9484-4e51-bc06-e7eaaa762849',NULL,'7253ff5c-97f0-4b8b-937c-77aeb4d79aa1','014b052c-d32c-4f79-bff0-ddcfbe5428c6','4','Expansion',NULL,NULL), +('3af9e522-a85a-418d-8b15-387dbf9002dc',NULL,'55b9e2fe-7bb0-405f-af8f-89db1b1ccab8','104743d6-f21d-46e6-95f9-a8397fd668c4','2','Expansion',NULL,NULL), +('3b019217-cd1b-4f70-8edb-b2b98acef4e2',NULL,'87b31faa-9523-480f-8ba5-759f36e3a8b5','9ccef53a-2f37-434f-9ed3-2dbd55f05ea9','1','Expansion',NULL,NULL), +('3b244046-5eca-468f-8d2a-98b399cfb905',NULL,'8ac56b80-55b7-48f2-85ca-f331f9b453fc','49ad472a-fd5e-48fc-87a5-4c6968f1da7f','2','Expansion',NULL,NULL), +('3dd3db63-cff9-4cda-8381-3a5dbe6db17e',NULL,'c9d381f0-9b78-4eb7-a269-e31c4604bb86','9325fd75-e49a-4f6d-92d0-4df112ceb5cd','1','Expansion',NULL,NULL), +('3e9bf727-ca46-48e8-a4d3-dc6cd8f097cf',NULL,'df35ebf5-880b-4052-b4dc-5fbf38a423ca','bbf63386-42ec-4cae-a6a1-a8dade4e09e1','1','Base',NULL,NULL), +('3fc60178-6d0c-42dd-a0e3-d9b68d88425c',NULL,'d189be23-526f-4995-b495-621b44216f5b','ae37e5e0-a7ee-40aa-9b88-7f7d29fd65f3','1','Base',NULL,NULL), +('3fe5467d-fdbc-4f16-bcbb-af0c578da755',NULL,'adf43808-1569-4361-b908-13566932fd41','41afcb54-a94f-4277-bc52-2c21aa31cbb7','1','Expansion',NULL,NULL), +('406da647-c7f0-4f88-ba8b-b423db45d0ac',NULL,'80457173-ec4a-41e0-a5a2-fb89746886d0','6834e030-5e32-4cd7-88de-289137296da4','1','Expansion',NULL,NULL), +('408d747f-cd07-456b-b5cd-c908e968987a',NULL,'e82b3c2e-c56c-4c45-92e9-c63fc10e75f3','721e45ff-89b2-4b98-abc6-3ff6e6802e57','1','Expansion',NULL,NULL), +('41afa0c1-f3a9-44e1-96e1-817d47c8838e',NULL,'e0297a51-c670-452e-b31c-c5b37c6ad40f','a903401d-08f8-42d8-9da6-d453bcbff604','2','Expansion',NULL,NULL), +('41c74f6a-c604-4362-8ab9-3027aade3090',NULL,'eb5a1e09-7f46-4f1c-ab7a-b017bad95261','fa1c8558-006c-4fb6-82f2-4fc0646d6b06','1','Expansion',NULL,NULL), +('42c3e004-d5f1-4dc4-ae09-fd329feb71d3',NULL,'2a81f0ef-823d-4e31-93d1-62fd0405c8de','06e3f0b6-2ca3-42ed-98d2-bdaddd65a137','1','Expansion',NULL,NULL), +('437768f0-3c9b-4fa4-8462-83c545bc8dca',NULL,'df35ebf5-880b-4052-b4dc-5fbf38a423ca','bbf63386-42ec-4cae-a6a1-a8dade4e09e1','1','Base',NULL,NULL), +('47947d94-17c3-49a4-9db7-62fd0e9c4b3f',NULL,'eff8cc59-53a1-4101-aed7-8cf24ecf8339','9b6abcd2-262c-4493-838d-48a5a16d3dd2','4','Expansion',NULL,NULL), +('4932bb37-cf40-42bd-bdb6-1ca501189b87',NULL,'ca2d8515-9eb7-48d8-8bed-71feaac8afdf','9b22ee37-f4e7-4ab2-910b-2b451680df6c','2','Expansion',NULL,NULL), +('4a2426c9-1c9a-45f3-9a51-e877b0376d0b',NULL,'a213e8d4-3140-4541-b65d-17ae2a78c3bd','b85b7098-5ee3-409e-8615-e95eb5aa74e7','3','Expansion',NULL,NULL), +('4a4d09f0-635b-4267-aba8-16bd407b9d86',NULL,'68c006af-1e78-4156-80d1-477716a2346b','60a1b82f-bb76-4222-a3d7-453c0439bd54','2','Expansion',NULL,NULL), +('4b3e6f46-9ff4-45c2-a682-ac1457cf4cd3',NULL,'547a7c06-48b8-408b-98fd-5827aa732419','cf3356d7-4be0-4adc-88c9-4e6c64e37623','1','Expansion',NULL,NULL), +('4eac77ec-41d6-44c9-b390-1e0ea3a2bd55',NULL,'bf801683-7b5f-450c-8bca-91f224025df0','32e3d429-9218-42a1-b6c3-28b9f43d92a1','3','Expansion',NULL,NULL), +('4fd4aefa-8281-4f69-9354-c3456e9ea224',NULL,'97fc1831-a34a-44de-ab82-3f6ad05e2dd8','30cc57a1-dc0b-4553-845a-cccceee8e5b3','3','Expansion',NULL,NULL), +('51a2fe54-0491-4c8c-bd96-69a33e4d633a',NULL,'86b9d7a7-6385-4ed7-bef7-0fc51bef8399','4db73447-dcd5-4667-a27f-cd8b2294afed','3','Base',NULL,NULL), +('52643a8e-7953-4e48-8eab-97165b2b3a4b','yaml','inv-uuid','fe6985cd-ea33-3346-ac12-ab1214812345','ff2ae348-214a-11e7-93ae-92361f002673','Test/vSAMP10a::vSAMP10aDEV_macro::PCM::module-1',0,'1'), +('5424b54f-0a79-4f89-88a0-2809b6c779b6',NULL,'fbf41f6a-5405-459b-a320-12f4786258b6','e218e4e7-5780-4b12-b14c-37cbc90902bf','1','Expansion',NULL,NULL), +('5426ba3c-57cf-4441-b762-7119194d01ef',NULL,'a8faba2f-1f83-4206-9818-d0bc7321753b','4bfd0a7f-fc43-4130-87be-fabf513b1ff9','1','Expansion',NULL,NULL), +('544d60a9-09ff-4d11-a3c5-41e31d91d251',NULL,'5eea66c8-e5eb-4aef-9095-879b6d1544a3','57aca1a5-2e2b-4301-9e39-9801404cc1b8','2','Expansion',NULL,NULL), +('56c33dad-e3eb-4beb-8681-dc7cee3787d6',NULL,'f9cde959-b0df-44be-b9c8-ba177939e7b5','8214ed2c-d02d-4d4a-83c4-cc8a6b1b9e4d','3','Expansion',NULL,NULL), +('57f5635a-31af-406b-bdcf-d7a296342a91',NULL,'9b30bca2-ec1f-4fdd-afc6-4fb298893801','b1c1f37e-41e3-4e06-8733-b70e5049aa88','2','Expansion',NULL,NULL), +('59755fa5-dbb9-44f3-bdc9-752c4d5b3fbd',NULL,'cafcd9d6-5963-41f4-8922-fc013382be8f','879faa16-dc29-4e04-93ef-d4cb168eeba0','1','Expansion',NULL,NULL), +('5a3ac46d-9136-4d70-a7e1-68569dbe7bf7',NULL,'6d7201a5-ca5d-4c70-8a25-9b898879bb68','ef8adb67-6f57-47eb-a823-4b0278d5a22e','1','Expansion',NULL,NULL), +('5aaf94d9-36e9-484a-bf1d-61ee8d4988b7',NULL,'a2281b35-31a4-4184-a20a-605446289059','df4ea923-5197-4faa-a0fd-e7895e4d5372','1','Expansion',NULL,NULL), +('5b055c57-abbf-411d-96e4-9f52d07c141b',NULL,'b3ae6092-1973-495b-9cae-5813679da421','e018151b-6c29-496b-92de-cd22671651d7','1','Expansion',NULL,NULL), +('5c4d883e-57a1-4b32-bff3-b05226ed8d47',NULL,'449f4443-4410-42a0-b35d-8db88da4cebe','13bd1bcd-dc69-4b1b-9230-57f431dfcc0d','2','Expansion',NULL,NULL), +('5e33c890-d453-47b6-a2e3-ab57014a7a96',NULL,'28eb58ce-b353-4a19-9c68-d2ae0a304583','db10d9fd-3483-450d-8e09-f969810fd80f','1','Base',NULL,NULL), +('5fec6284-e354-41eb-aab6-def3233af64d',NULL,'a8faba2f-1f83-4206-9818-d0bc7321753b','4bfd0a7f-fc43-4130-87be-fabf513b1ff9','1','Expansion',NULL,NULL), +('605ad028-8498-4eaa-a36f-543aa25470b0',NULL,'69ef1dc0-adc4-4a16-9ad7-91fc898ba31f','6644cdc0-7f2f-4ba3-8221-81ff8bc0998a','1','Base',NULL,NULL), +('640a174b-44fd-4719-aac1-a98adfebce11',NULL,'7cf76f4b-cdf7-4a04-8396-9df44e3ea7b5','400f9a69-ae10-4825-885d-bd6627c01b8e','1','Base',NULL,NULL), +('646fef85-9650-43f9-9a49-40bbde90c0e3',NULL,'5df8ce8b-45ab-4265-a9a5-e87a7f4ee007','78f91537-c44f-4043-b593-bab033187a6c','1','Base',NULL,NULL), +('64d22ab3-0e27-49e8-b649-0b959054a3f3',NULL,'c1d7b9fb-5948-49d8-937d-f64a7006b552','62e53e0b-785a-4535-ba07-9ffb047d2057','2','Base',NULL,NULL), +('659fb183-2cf5-41c2-81c6-66246195d805',NULL,'264c8fd9-cb33-491a-b1d6-0059a97eb6f4','57996fa7-b8f3-4589-84c5-0707d397e1a1','1','Expansion',NULL,NULL), +('65ba8f6f-0b4c-4920-a284-c47a6da798c8',NULL,'f4e48ec2-47c9-4ef6-bb0e-9b580014a1fd','754eab9e-2eea-44c8-8df9-3f5d82d5c45d','3','Expansion',NULL,NULL), +('667892de-3e65-48ff-ace7-bba3e7a3c047',NULL,'b74a8ba7-ba07-418f-8f9c-1466e4981771','70d3feed-7a51-41fa-a291-52a5fef4bc61','1','Expansion',NULL,NULL), +('66c428b1-a020-4113-848b-159e31d9c16e',NULL,'d16300c1-1cd4-4426-b30f-aa4a1784c52f','300af813-d0f2-44a7-8a27-d46f06ade407','2','Expansion',NULL,NULL), +('671376d5-8689-4788-8eae-f59648fa373f',NULL,'f02190b7-0e49-4cff-8873-c055e7ebc6ad','cae6741e-8e23-4cdc-a792-ae89e4db5531','2','Expansion',NULL,NULL), +('678264c4-f573-42d1-8de6-1a3f85f5531a',NULL,'2e94c5c8-521e-436e-a429-83fbaf6e3106','8c8b5ffe-4bf8-4b4a-b5a4-809f9ede16a3','3','Expansion',NULL,NULL), +('68bad53f-ab49-474b-8322-b0d69f3a64cc',NULL,'23befc6e-aa97-4004-b215-4979c3f84913','dea8e41f-c996-4557-b521-263210d96baa','3','Expansion',NULL,NULL), +('696b6cff-0173-4603-985c-8246ad6316a7',NULL,'8a8e0578-135a-4144-adf7-b02ba6bf248e','ef4894f3-9573-4616-879a-7defb9eb2806','1','Expansion',NULL,NULL), +('6a095b7e-f6b9-4772-a60b-66f1b57425da',NULL,'55b9e2fe-7bb0-405f-af8f-89db1b1ccab8','104743d6-f21d-46e6-95f9-a8397fd668c4','2','Expansion',NULL,NULL), +('6a55d558-e36a-49e4-827c-34cc016fc41f',NULL,'05f96ce4-b412-4e57-9fb1-1b3095cd8b83','1a24df30-b3a9-4f05-91eb-aa4a1b901ba0','1','Expansion',NULL,NULL), +('6b2678e7-9ee6-4292-a769-8b6c0936e360',NULL,'24d39fc5-05ac-4d9e-b6e9-5635d58837a6','4914e043-954a-4421-864e-bc8f3ae8e6b9','2','Expansion',NULL,NULL), +('6b7eaa3f-ea2a-434e-8b06-212d7942940b',NULL,'82552e8e-7fab-4ca7-a6cc-c71a16f342d1','0a425002-065d-4f1f-879c-f524918babfc','1','Expansion',NULL,NULL), +('6be48e52-3d79-44a1-940f-8aeb301347dc',NULL,'ccdcf017-5cd4-4829-8c1e-3af9cc1c72da','9c468481-1b9a-4675-a717-cc9840e68626','3','Expansion',NULL,NULL), +('6c6d785e-4278-4f79-bfb5-b08d9a716874',NULL,'769180bc-972a-4ea2-9d20-f026551a9eb5','99ad52c2-36e7-44ae-8449-b2b16d2b1a81','1','Expansion',NULL,NULL), +('6d6858ab-19d6-4b57-8ae9-ae4aeaa85b84',NULL,'367d243d-a279-4a92-a751-0ed64c9dfa20','0d12a1af-692c-4903-bd3f-589f67c03638','1','Expansion',NULL,NULL), +('6e6a94f6-f137-453b-9fff-fc8bb8b48334',NULL,'a0bd4b05-4158-40d7-bf36-5e6d6589ffc4','c5fd8e94-9db8-4e3a-a4a5-c17ebea49553','1','Expansion',NULL,NULL), +('6fdb77af-b4b0-48ed-b71e-3061a7fe5221',NULL,'0f7f7a05-1160-4df8-8339-45114b7050ef','fb292f29-1fc8-4305-8436-174a5a78854f','2','Expansion',NULL,NULL), +('6ffcd5f5-3b70-4d6a-999e-5664b5235fdd',NULL,'bcb09cf9-c55b-4390-b1ca-077cfc3fbc7c','d1d62a25-4d08-4a13-bc18-368a9b618c70','2','Expansion',NULL,NULL), +('71b8ad04-04ef-4024-a933-08d7a39dd1e5',NULL,'f45aa352-8e76-4ae6-adc1-340c953221ed','d8aa5542-a8e6-4205-a37d-bfdda4ff88d9','12','Base',NULL,NULL), +('745df1ff-5767-407f-be02-468a9958127b',NULL,'41ea2a92-7467-4847-a100-c3a5e5cbd206','5a7ba9d9-c932-42f0-bec1-38bb1ae72fe3','1','Expansion',NULL,NULL), +('74990029-180c-49b9-872f-a8cff4d20809',NULL,'c3eb5880-1370-4f47-8cdc-72a539782c63','f961726a-0fa2-4a68-805b-65c8421efc6c','1','Expansion',NULL,NULL), +('74dc8145-0035-469a-922f-795afe676331',NULL,'0c669166-b61d-494e-b98b-829aacf4a48b','119e7de9-bd94-4ea1-88de-d4b5daef7373','2','Expansion',NULL,NULL), +('75d0ac58-9a05-4cc4-90f2-1e582df39eba',NULL,'dff23ac5-31db-4e5d-bd4c-189363273337','f22af421-578c-4e91-ad8c-3d63134791e0','1','Expansion',NULL,NULL), +('766f0cd7-7853-4bca-9620-43ba51802265',NULL,'8cef0a5e-ebc0-4222-afdf-b78a5a0b2f64','706cf476-acd6-4f17-bae8-646deaad9193','2','Base',NULL,NULL), +('785a4b27-cce0-437e-bf38-fb81dadb7c50',NULL,'22287914-c1f6-4378-a45d-21940fb0f54a','4c21a20f-650d-427a-ba24-43218630e602','2','Expansion',NULL,NULL), +('79d36486-38d5-4a24-be6c-4727931ef9c7',NULL,'83c7153e-c078-48b9-8134-d62901829ecc','3059d30c-6739-48bd-bdc4-88bd7a80b829','2','Base',NULL,NULL), +('7ad564c6-939d-47b1-a2ee-5140d000571c',NULL,'aae15bb7-0ddc-4876-be4e-dcc830d09e4d','0347e2b3-3025-459c-8482-f1897d3207ca','1','Expansion',NULL,NULL), +('7bc82047-44a5-4e36-b273-fc4c99125111',NULL,'c5f7d89f-dfdc-4e4b-961c-321ab9142877','aff2cf25-eac4-4c09-adba-f74ffa523511','1','Base',NULL,NULL), +('7c5b298c-069b-4f0b-a6d4-8f7a62c368cd',NULL,'dff23ac5-31db-4e5d-bd4c-189363273337','6d6ede06-b8b6-422c-a4b8-df062d20385d','2','Expansion',NULL,NULL), +('7c83160a-27c4-469d-9666-2c3d07bbb91c',NULL,'7e2402f7-411d-4978-b92c-680d426d4dd0','0755192a-fd92-45f9-b531-7b257c1a5552','1','Expansion',NULL,NULL), +('7d967a5e-a3f9-453c-b7f8-70ac1209ec92',NULL,'57003ff9-49a2-442e-9b66-81303afd5a74','34311082-3c51-4ea4-b8d8-63de665fb820','2','Expansion',NULL,NULL), +('7e73aa9d-8908-4c0d-be4d-e8d35c6fd57f',NULL,'53392901-3530-4022-9450-5ab1501235c4','e7b801c8-cd1b-420d-9cda-3cd1f90137eb','1','Base',NULL,NULL), +('802f6145-7bae-4b71-bf3e-94102e6bb1bd',NULL,'13214374-2ac0-4028-87df-d32722afd5ff','b8765c92-5d63-4227-8e29-0c98b3adca41','3','Expansion',NULL,NULL), +('81867fb7-528f-4a1f-acf7-9f177def72b9',NULL,'c1d7b9fb-5948-49d8-937d-f64a7006b552','62e53e0b-785a-4535-ba07-9ffb047d2057','2','Base',NULL,NULL), +('819ef122-ca19-4141-a61e-62922f8fc279','yaml','inv-uuid','fe6985cd-ea33-3346-ac12-ab1214812345','ff2ae348-214a-11e7-93ae-92361f002673','Test/vSAMP10a::vSAMP10aDEV_macro::base::module-0',0,'1'), +('82459961-dc30-4d19-af75-8a43a81c250f',NULL,'3da79280-3c3e-4e6e-9f51-26ba20262f82','34f21239-d535-475f-90cd-de40f12dc4a5','3','Expansion',NULL,NULL), +('824a6b58-9a88-43f9-890e-7e88bb78746d',NULL,'c1d7b9fb-5948-49d8-937d-f64a7006b552','62e53e0b-785a-4535-ba07-9ffb047d2057','2','Base',NULL,NULL), +('850fe25c-cf1e-4b55-ab89-7f50fccc63e4',NULL,'4f9880d1-cd04-4ac8-b7fa-7cdb85bd90e1','b6c59f4d-25e5-4b1e-9f31-ea12640ae88f','1','Expansion',NULL,NULL), +('86af9613-9bcc-4dee-9c83-8314bee4dd2e',NULL,'3fd5e96c-8578-46e4-b300-28ca72a72d68','3880717c-5f00-4c9b-91ff-3f1c272a6c80','1','Expansion',NULL,NULL), +('87879a89-7d64-4da6-afba-1736019bed05',NULL,'80ff85fb-cb11-42cb-9737-e47095d42756','01166434-ef34-4969-aaf2-626203d72e48','3','Base',NULL,NULL), +('87c255ea-0ff9-4c53-92eb-618d7f6cb84c',NULL,'3dbd19c9-fd43-4836-a2f6-6ae072854a20','a9aa9405-9173-45f7-aaed-a5cc51a819fe','1','Expansion',NULL,NULL), +('89c055db-0614-4ee6-99df-364d88ca6fac',NULL,'41ea2a92-7467-4847-a100-c3a5e5cbd206','5a7ba9d9-c932-42f0-bec1-38bb1ae72fe3','1','Expansion',NULL,NULL), +('8aad46b1-5672-46e8-bf3d-82ac59b31223',NULL,'ae0e1de4-58e0-4e52-8d2d-4e92789da644','7401b558-48b4-45a2-bc50-fd002a18d9e5','2','Expansion',NULL,NULL), +('8b8f0316-70f7-4e92-b1d9-c59d8601ad27',NULL,'df35ebf5-880b-4052-b4dc-5fbf38a423ca','bbf63386-42ec-4cae-a6a1-a8dade4e09e1','1','Base',NULL,NULL), +('8c6705a6-dd2b-4e95-b311-5e9e1c501ea2',NULL,'a60f3f27-575c-439f-87b7-cf43af4f9212','37edc7b5-0d8f-4cd1-a5e0-38a4f266f2bb','1','Base',NULL,NULL), +('8ec1db74-1698-405a-8258-f1e377db1c93',NULL,'180e8190-6159-4568-bf54-af11489c093e','7a81dcb3-01c2-468a-94e1-7d62f802716e','1','Base',NULL,NULL), +('8f810b5b-e901-449a-93de-c334ae353f0b',NULL,'22287914-c1f6-4378-a45d-21940fb0f54a','4c21a20f-650d-427a-ba24-43218630e602','2','Expansion',NULL,NULL), +('8fb8d253-465c-4967-b816-afa23e3a260f',NULL,'96885133-398b-4572-96b3-ffa77da9d9f3','4c5c2ed5-0bc7-406a-b95f-8c128c522141','2','Expansion',NULL,NULL), +('8fc20efc-afb8-4b15-921b-ed0b486d4e8d',NULL,'2fb28e79-e6f2-4cdd-832d-f191244207e5','04854ad3-6b53-4f04-a14a-6f68a839b62c','1','Expansion',NULL,NULL), +('8fe6a184-b66e-486f-bbe1-0a0515bc7619',NULL,'b3ae6092-1973-495b-9cae-5813679da421','e018151b-6c29-496b-92de-cd22671651d7','1','Expansion',NULL,NULL), +('90ac24c0-3ab1-4500-9959-e112e71a2b25',NULL,'67c9966c-e0fc-4938-be0a-c2d56fc078e2','5acf8675-18b7-40a7-a7cc-973dc324a5ab','3','Expansion',NULL,NULL), +('922ed4fd-0393-4845-92bf-ec8ec16c0a35',NULL,'4e23c086-568d-455f-9fd3-78385ea07f5b','11346175-92c0-4acf-ad03-dfa58a0572f7','1','Base',NULL,NULL), +('935de7c7-562e-4b5a-960c-881cf5827b05',NULL,'fd756115-e0b4-4341-8ef1-79ebc9f985eb','eec17d4d-5bb4-4f56-9f8c-591f2e572631','3','Expansion',NULL,NULL), +('93623be0-bd76-4d21-8c79-1f80afe7a913',NULL,'1b794a81-9a5d-47e7-86ea-f18c27100a2d','aac6fecd-f110-4c7e-86e4-880f46f75689','1','Expansion',NULL,NULL), +('94b2b4d7-b258-4349-981c-67e26503d70a',NULL,'35cccd23-8c7b-4c96-a6c0-76317248d50e','8e65ecd1-06b7-4e0c-b23a-4c5b3e08cc9a','1','Expansion',NULL,NULL), +('96c9ae68-9212-4955-ac9d-69f0f2205f70',NULL,'df35ebf5-880b-4052-b4dc-5fbf38a423ca','bbf63386-42ec-4cae-a6a1-a8dade4e09e1','1','Base',NULL,NULL), +('97bb1d8e-6bce-469b-b899-47e26210f5f5',NULL,'7e2402f7-411d-4978-b92c-680d426d4dd0','0755192a-fd92-45f9-b531-7b257c1a5552','1','Expansion',NULL,NULL), +('9962eece-474c-4ba3-a149-9e3856179bb6',NULL,'a596b2f4-74c5-4a7f-9e0a-a9437cc573f7','1feefaec-46a8-438a-921d-c6da2e74c2fe','1','Expansion',NULL,NULL), +('9b045d36-df11-4fde-a525-9a862c604bf2',NULL,'69ad845f-3589-41e2-a373-217599966953','0be84e4c-a69e-40f0-8b9d-aa0882de154d','1','Base',NULL,NULL), +('9c038c1b-64a8-4ae1-903f-c5b8c5b09665',NULL,'856f7b1a-830f-47b3-bba6-a2d54e5c72f8','d9153096-7f86-4c0b-9581-6611c965827c','2','Expansion',NULL,NULL), +('9c75c94e-0af0-4d5b-87ec-ae76aeeb7cf9',NULL,'fd756115-e0b4-4341-8ef1-79ebc9f985eb','eec17d4d-5bb4-4f56-9f8c-591f2e572631','3','Expansion',NULL,NULL), +('9cbcaa70-d7d7-43f7-b0fa-489b8ee6230b',NULL,'b111a6c9-1316-4133-b9ec-3be90e84afdf','4cf7e6f4-c748-490c-be04-67cd9b67d215','1','Base',NULL,NULL), +('9d076607-bf44-48d6-a0c7-5659b0b808b4',NULL,'83c7153e-c078-48b9-8134-d62901829ecc','b3cdf066-bd51-4316-878e-4f261a517407','1','Base',NULL,NULL), +('9d6ec5b0-f4fc-4320-a2d0-a3599dafcee5',NULL,'ca2d8515-9eb7-48d8-8bed-71feaac8afdf','9fb7b403-3ae2-4624-a4eb-3e70a016ef9e','3','Expansion',NULL,NULL), +('9e006a64-819a-4037-a2a2-902b78da277a',NULL,'45cbf47f-039d-4a7f-a80b-cc989355f8bc','ea43f3e0-ea7f-4ead-a5c4-236de5833675','2','Expansion',NULL,NULL), +('9e310624-a0f2-47f8-81f4-09c74aa85edc',NULL,'143477a0-d9a1-4b09-9ac7-2318039319ba','f01c87d1-bce1-49bc-b188-aa6e20a67ced','1','Base',NULL,NULL), +('9e4fdf97-47d0-4c11-9db8-a71028507be8',NULL,'a8faba2f-1f83-4206-9818-d0bc7321753b','4bfd0a7f-fc43-4130-87be-fabf513b1ff9','1','Expansion',NULL,NULL), +('9e7078d6-5959-44ac-924e-0b51e9488efa',NULL,'53ea883e-8eae-456a-adfa-f08739e09e0f','7b680fb3-c2cf-45c4-9481-fcc3a0c69d36','1','Base',NULL,NULL), +('9f4167aa-88f5-4745-a614-06c99d3c1a4d',NULL,'8a4b2976-76c1-41dc-a27b-f167ef7068af','6a066eb0-b9ed-49dc-a7db-bdd8be6deee2','1','Expansion',NULL,NULL), +('9fb239d4-fe2f-47f3-aecf-b3b75a5fae41',NULL,'1d91dffa-b52f-428c-998c-b655118e806f','d6fa151b-d374-4eb9-93fd-d039dca3229b','3','Expansion',NULL,NULL), +('a074136b-3a39-496e-ac5c-b3992d380682',NULL,'68c006af-1e78-4156-80d1-477716a2346b','60a1b82f-bb76-4222-a3d7-453c0439bd54','2','Expansion',NULL,NULL), +('a1409bda-4ed4-4f65-842e-ff8168056065',NULL,'6ca5e94f-7a40-42ab-a4ec-65be9c94dd22','c29ff7ff-bca6-42a6-8427-07b3e44a0a5a','3','Expansion',NULL,NULL), +('a59a4a1a-a3b8-4ef9-9d9b-2666f7e263c4',NULL,'80ff85fb-cb11-42cb-9737-e47095d42756','01166434-ef34-4969-aaf2-626203d72e48','3','Base',NULL,NULL), +('a731ce5b-e125-4e1f-a4bc-8595d36dfe42',NULL,'9b82936a-8fb0-492c-8517-f3f13e224577','6c294358-6111-42d6-b418-41225ff201cd','2','Base',NULL,NULL), +('a73ef048-c6e4-4d42-87e7-b1333e018128',NULL,'e3e52111-f617-4ce7-a6a8-465e23a33b25','52bf4315-5a59-48b5-9b63-127011cf1760','2','Expansion',NULL,NULL), +('a86d3649-b20b-42c8-93d6-6817173b0ded',NULL,'a61dcf48-f4db-466f-bfe7-81a15776a41f','7abedd84-d10d-4daa-8d9e-1ac5e6c53853','1','Base',NULL,NULL), +('ab2e647f-c159-436e-bfe2-9b11d10b4053',NULL,'c1d7b9fb-5948-49d8-937d-f64a7006b552','62e53e0b-785a-4535-ba07-9ffb047d2057','2','Base',NULL,NULL), +('af967b00-eb8d-4934-bd5d-018ae4dc3ed3',NULL,'e0297a51-c670-452e-b31c-c5b37c6ad40f','6f09e053-56a6-4fbb-8299-e1de616825cc','3','Expansion',NULL,NULL), +('b031bfb0-e1a1-41a1-be29-8387f9b65f15',NULL,'ff932c01-9b9d-4914-aeff-847620b23c75','1035210c-b42d-4e32-816b-6fa7587e2447','2','Base',NULL,NULL), +('b0a38c33-4464-4dc2-86dd-20fe9e4aabec',NULL,'07bc6fcb-fbce-45be-99b1-151d00b3738a','a4528198-ed1f-433c-836b-5b6a1ca231ef','2','Expansion',NULL,NULL), +('b0dcaed4-18ea-4afd-a34a-ddfd3dcb7b70',NULL,'2dc6e60c-6971-4db6-98a6-0f42ee05231c','5d292079-dec7-4121-8a53-93739d345494','3','Base',NULL,NULL), +('b458f4ef-ede2-403d-9605-d08c9398b6ee',NULL,'6ee87d26-266f-4669-9d7d-9324802c24c9','e99b85bc-5f07-480a-bbf0-d5880a12469e','1','Base',NULL,NULL), +('b62cc06c-4d23-40a6-9e56-7b1e00e731f9',NULL,'30fe8d84-fbcc-43b5-b8f5-cad24f52d181','8400d0eb-20f4-437d-b655-2eac59677478','1','Expansion',NULL,NULL), +('b66bd427-02d4-44ea-8117-6d1d1441fdad',NULL,'b4a3e1f7-dbd2-481c-a22f-fda382bbb90c','bf73d965-216a-466a-be7e-1dfbefa91be4','2','Expansion',NULL,NULL), +('b8cdb3e3-43cc-4eac-b886-ab0e408e4325',NULL,'a5d2f324-5a20-4343-9d8a-72b305244223','89ecf791-fae7-491c-b0a7-e7a25d2057d6','2','Base',NULL,NULL), +('ba3064d4-69c0-43a4-a435-522ef1029af6',NULL,'7199aba6-a1ee-4af6-80a4-145093b816ef','333c95be-48e2-489b-a301-4b5216e2c7da','1','Expansion',NULL,NULL), +('bc77e17a-be43-420f-94f3-30d129dd31b3',NULL,'a8faba2f-1f83-4206-9818-d0bc7321753b','4bfd0a7f-fc43-4130-87be-fabf513b1ff9','1','Expansion',NULL,NULL), +('bcba9935-2a86-42c7-abd8-2cbf330fd820',NULL,'855ace80-8d5f-4e04-ae95-5da3b5e2ec36','e3387a8e-839d-4644-b9e2-87e0cc3e41d3','1','Expansion',NULL,NULL), +('bf182e13-b670-4b6d-a03e-907d40e153ea',NULL,'f34c0c11-4320-4538-9a57-edbbd0075389','6af103fc-79a8-4c70-a949-24a4696b33de','1','Expansion',NULL,NULL), +('bf3c0f68-8fc5-44eb-a5b6-c392c40ae685',NULL,'da8f1dc1-db44-4ae5-905c-757ef275d113','390b20da-b182-4561-976d-a8e8db27137e','2','Expansion',NULL,NULL), +('c03772df-9da8-4e47-b145-4492b7cdc2e0',NULL,'638c6130-06fb-45c3-922d-170e5aac08e7','a76cbb00-2e6b-4297-8a57-20f71e0583c3','1','Base',NULL,NULL), +('c04b672c-914b-4ba6-821b-2dd72ea2f471',NULL,'6e218679-f27a-4b90-adba-f9002079c41b','2243dc06-1b52-4a56-abe1-39d7efed538d','2','Expansion',NULL,NULL), +('c0720fe9-918c-4134-9c94-15362364c66e',NULL,'a27ba469-c844-4fcc-a4d9-e6a794286362','4e232768-d04f-4231-be78-34fed7e7981c','2','Expansion',NULL,NULL), +('c24c2bcb-b6c4-4ff8-8bb3-a45abde0f379',NULL,'30fe8d84-fbcc-43b5-b8f5-cad24f52d181','8400d0eb-20f4-437d-b655-2eac59677478','1','Expansion',NULL,NULL), +('c3dcba9e-0fda-4491-ade2-98f47d93c7d0',NULL,'ff932c01-9b9d-4914-aeff-847620b23c75','1035210c-b42d-4e32-816b-6fa7587e2447','2','Base',NULL,NULL), +('c42ba9fe-88f5-4c03-ac93-fde1ba9d405d',NULL,'bcb09cf9-c55b-4390-b1ca-077cfc3fbc7c','d1d62a25-4d08-4a13-bc18-368a9b618c70','2','Expansion',NULL,NULL), +('c438643a-73d2-402d-9eb0-84be3d1f68e9',NULL,'57003ff9-49a2-442e-9b66-81303afd5a74','cacf1996-a09c-478b-9db4-3017df786449','1','Expansion',NULL,NULL), +('c5a6b0f6-1402-40c2-a732-f45a7460d0dd',NULL,'34ba13f5-62db-4179-bc38-bbe6cfc4ca2d','4c53f3ee-6c6b-43fc-88cf-6ba7c451b7cd','3','Expansion',NULL,NULL), +('c64de178-5b3f-4040-b8f9-14cfc145d993',NULL,'e3fb4ced-d031-452b-9810-b96ffdaf0715','8225fcc9-e083-4328-8199-a13e0dcb7f35','2','Expansion',NULL,NULL), +('c6e2df96-763c-491d-9664-e6240db1182f',NULL,'894da0c8-2eae-4c2e-b9e4-c1923bbd1487','b34d88e6-2d57-4bb8-ae60-69b7765effa7','1','Expansion',NULL,NULL), +('c7b61236-e20c-4ce4-b18c-ac487ac747a2',NULL,'df35ebf5-880b-4052-b4dc-5fbf38a423ca','bbf63386-42ec-4cae-a6a1-a8dade4e09e1','1','Base',NULL,NULL), +('c7e40081-48ac-4d7c-9ce4-7c1082a44c5f',NULL,'c66dc598-212b-4d60-8201-53f0e609d1d1','16f1a93b-203d-4c4b-af9d-3e5971abbcea','1','Base',NULL,NULL), +('c8923ecc-afd1-4271-9bd7-8f023b4f7392',NULL,'d3f5594c-ca4e-42f6-9456-66af48b5d91b','652cfd56-0578-4e93-a1e1-f97a3c3c804a','3','Expansion',NULL,NULL), +('c8a1b548-cdfa-45c4-ba5f-3260158e57a4',NULL,'2fb28e79-e6f2-4cdd-832d-f191244207e5','04854ad3-6b53-4f04-a14a-6f68a839b62c','1','Expansion',NULL,NULL), +('c9dd02e8-470c-4c54-bddb-3e7bf430d7e1',NULL,'22191997-1f10-43af-8644-b2a032ac52d5','fa84b0ff-79a4-4cd1-a488-1a2f282a178c','1','Expansion',NULL,NULL), +('cc9a5c63-471e-4f7b-9375-168d9de29374',NULL,'44545e64-5b78-4780-8cfc-04a7869d254f','08c3cfce-e549-479e-adf4-ed1e39daa694','1','Expansion',NULL,NULL), +('cd61a2d2-cce9-4ac0-b167-27b84a8833b9',NULL,'58549ef0-e847-4e55-a7e0-57175c5f613c','f1947594-b787-4195-93b7-a26b7e2047f1','1','Expansion',NULL,NULL), +('cff51306-3e71-479d-8bf2-c45e80de75e5',NULL,'114415eb-6389-413b-987a-fca54accd681','a236add5-67f2-4044-8f14-d69d1baee994','1','Base',NULL,NULL), +('d0155d09-b4c1-47f0-8941-0dcd1cc7f8a9',NULL,'f55a7a9b-b509-453e-80de-2aa004c2bb17','96454f0c-86f3-4993-ba3b-8c437d3da380','3','Expansion',NULL,NULL), +('d0220f8d-4dd1-4b39-b25f-9f9f70d979dc',NULL,'24cfd9f7-146c-498e-a9ca-74795536bee7','2ef57504-771c-40c2-a173-293a1bc0458d','1','Base',NULL,NULL), +('d02645bb-c17e-48ef-a5b1-4132182c8781',NULL,'df121619-2d8b-4826-92ed-508b18a0ed39','345c0d38-4a26-444b-a090-751c6bc0ce41','3','Expansion',NULL,NULL), +('d09f617d-0cd7-412a-bd44-6e75b73cb9bf',NULL,'f45aa352-8e76-4ae6-adc1-340c953221ed','75eed7df-995e-4775-8bff-9cbd3bd2d35f','11','Base',NULL,NULL), +('d17c6039-548a-446d-b5e5-3a092fe2ffa2',NULL,'6e17bf6d-548c-4d89-9d73-c2e2dfa71b0b','222145b5-56f7-4263-bbb0-e1519f74b2fa','1','Expansion',NULL,NULL), +('d1ff7261-3548-42ea-8002-decbb30b0ba0',NULL,'23befc6e-aa97-4004-b215-4979c3f84913','4cf78631-996b-4a1d-9307-f781c00c733f','2','Expansion',NULL,NULL), +('d3c06505-b1b3-4554-9b8a-b1ef97982c14',NULL,'2b3dae4a-9bdd-462b-90fe-afdb2ba25c19','a62c7540-d9d0-43da-92e8-59bd4332edfe','1','Expansion',NULL,NULL), +('d5b21eb1-1136-49a6-95b8-3466a9768bad',NULL,'3816617b-46e4-4401-9f63-99d5eea7b3e3','d8ccab86-4a1f-49f6-b150-9ee83a9e4ace','1','Expansion',NULL,NULL), +('d6b43575-63be-402f-bedf-5f362ad2d186',NULL,'7628605b-bf63-49ae-9167-bde09df73166','060d3229-d944-4f58-94c4-3e29d2182abb','2','Expansion',NULL,NULL), +('d7df8116-e8bb-4748-b46b-e8264f324646',NULL,'e61d00d2-7be4-4549-8b74-9933fd45c181','1175a4d5-49a0-44fc-b0c7-08188fd44722','1','Expansion',NULL,NULL), +('da400dd2-11fb-4387-b9db-8af6c2a1a8e2',NULL,'2dc6e60c-6971-4db6-98a6-0f42ee05231c','003fbc2e-4743-4c86-90cb-622812cef8e0','2','Base',NULL,NULL), +('dd130cdd-d1f7-4087-a27f-c37c683ee38c',NULL,'39486d7f-b659-46e5-a164-cba8136ec77f','d520cbda-841b-4735-8671-feddb1350dfd','1','Base',NULL,NULL), +('de7ebfda-e96b-459a-8e50-ee3e1ed5b5d7',NULL,'a8faba2f-1f83-4206-9818-d0bc7321753b','4bfd0a7f-fc43-4130-87be-fabf513b1ff9','1','Expansion',NULL,NULL), +('dec731f9-266c-4a71-844e-fd1649ea1fe1',NULL,'f010ba64-9e45-4e9c-9903-65d475f77ed8','1b56a850-8001-4f77-8706-1aaf8829e461','1','Expansion',NULL,NULL), +('df40c854-7dcd-47d3-b2dd-ddb5c7996336',NULL,'c1752553-34c4-4cd9-9962-e2e822d8718b','25659306-4c56-4d58-80d7-25602ecd8456','1','Expansion',NULL,NULL), +('e0718752-54cf-4535-9793-b695da1aaed6',NULL,'2c0d78c2-9e41-4388-b6fc-bb456d4254c9','0a7df31a-4c9e-4a55-a195-92b754c7fd0a','2','Expansion',NULL,NULL), +('e21702a8-907a-4f78-a6ae-d667ce511b7e',NULL,'554e15f5-3c69-45fa-b71b-d0b85dd5c9c1','ed3dbc17-53eb-434d-90a2-73a6b3760417','1','Base',NULL,NULL), +('e2609a23-74cd-44d4-88c6-7685ebfe1fdb',NULL,'2638a531-c5d0-42cb-9466-b24de1680ffc','ac53bd31-b2b1-42ce-826a-a9420712cbff','1','Expansion',NULL,NULL), +('e29a3919-8a4c-407e-9c40-29552b82804a',NULL,'7e2402f7-411d-4978-b92c-680d426d4dd0','0755192a-fd92-45f9-b531-7b257c1a5552','1','Expansion',NULL,NULL), +('e3ac1662-3b03-4646-95c9-eb396b91d733',NULL,'51a8be82-b1e1-4d31-bc5f-c945d46bfceb','c4de5251-b5b1-4e30-adf2-0e5816958077','2','Base',NULL,NULL), +('e45d5b08-d8c9-4470-8cda-d7bca56508f7',NULL,'12c572d8-9782-4f81-aa78-b232709f57da','a609deb0-13c6-4b7d-916f-3f49eb3579bc','2','Expansion',NULL,NULL), +('e778800a-b181-4f6c-8bef-16e7540e0894',NULL,'48dcff69-d4eb-4ba4-8d87-0f8aa9b78689','6fd07519-c8c6-4510-85f9-3a7515fe5e7f','1','Expansion',NULL,NULL), +('e8f1bd87-2349-4bff-a0e3-38d2aa638889',NULL,'461b2d7a-97c9-4a55-980b-418b5d832f28','8c77ca52-c1c8-4e83-94fc-04ce2b17e02d','1','Base',NULL,NULL), +('e9d29fdd-0326-4a53-a9c8-dfcae94696e9',NULL,'fc5763f6-0876-40ca-b7f0-5182e021f6ed','8fbc2b4e-d129-477d-8b43-d2841508578c','2','Expansion',NULL,NULL), +('e9d7f357-bf0c-4865-95cb-ed2439c63d79',NULL,'ddc73cbc-90ab-473b-b978-7f3ee37169be','37f2f58e-7e88-4c85-b70c-f82e7d7a3694','1','Expansion',NULL,NULL), +('eb9db5a3-2aaa-40dc-a5ff-b4341a0863e2',NULL,'80ff85fb-cb11-42cb-9737-e47095d42756','68a5eb13-6887-4d22-ae22-927efdec8925','2','Base',NULL,NULL), +('ebbcbcca-9397-43f2-b1e0-95f445701268',NULL,'55b9e2fe-7bb0-405f-af8f-89db1b1ccab8','104743d6-f21d-46e6-95f9-a8397fd668c4','2','Expansion',NULL,NULL), +('ee0ff917-f119-4c3e-a81a-19abc04be3aa',NULL,'8ed0d773-f6c2-4a1d-aec9-c87ab66b4e57','0688e725-5af9-43b6-be02-c40bd479f6a2','2','Expansion',NULL,NULL), +('ee43bb7f-e4b2-4a60-a62c-3cef383ed20c',NULL,'a596b2f4-74c5-4a7f-9e0a-a9437cc573f7','1feefaec-46a8-438a-921d-c6da2e74c2fe','1','Expansion',NULL,NULL), +('f0c7d780-5af6-4519-85fc-784b43f84725',NULL,'e61d00d2-7be4-4549-8b74-9933fd45c181','212d4f97-019a-4820-a71e-5d92d5734906','2','Expansion',NULL,NULL), +('f2479ef3-06bb-4669-825d-67d30dfd3322',NULL,'b3ae6092-1973-495b-9cae-5813679da421','e018151b-6c29-496b-92de-cd22671651d7','1','Expansion',NULL,NULL), +('f2bfb366-2027-4fbc-95a4-c8967c577813',NULL,'de877de8-8519-445d-b582-1089e7856d04','819b60c1-302d-4461-82e9-864f3607e776','1','Expansion',NULL,NULL), +('f2c84c2a-b199-4fdb-a334-71002d5f7260',NULL,'2fb28e79-e6f2-4cdd-832d-f191244207e5','04854ad3-6b53-4f04-a14a-6f68a839b62c','1','Expansion',NULL,NULL), +('f2cbfead-1c9e-4756-a053-cf34f1b6eb4d',NULL,'7e2402f7-411d-4978-b92c-680d426d4dd0','0755192a-fd92-45f9-b531-7b257c1a5552','1','Expansion',NULL,NULL), +('f30a1485-929d-4fc5-b678-05cb18a5b5d2',NULL,'10c7ad74-0e32-4a6c-a065-7ce850f2d65d','56f3f5b8-98c2-4293-93a2-6b0120c77871','1','Expansion',NULL,NULL), +('f46f2c00-cfc1-4bf7-8143-326af473d420',NULL,'5e6660dd-2317-49b0-b893-8505c8e185df','1a295f64-eb36-45f0-943b-911445b6caae','1','Expansion',NULL,NULL), +('f4b50017-b8d7-442e-848f-74844353cf90',NULL,'9b30bca2-ec1f-4fdd-afc6-4fb298893801','b1c1f37e-41e3-4e06-8733-b70e5049aa88','2','Expansion',NULL,NULL), +('f4f294fe-881f-4517-87bb-ba0500bc43a9',NULL,'e35c8255-bb7a-4a56-9ed7-b44fb1474581','1abdeb20-b3c7-4ef7-96f6-964691d73ec1','1','Expansion',NULL,NULL), +('f515095b-7030-40ec-ac9e-7f046c1435df',NULL,'8a8e0578-135a-4144-adf7-b02ba6bf248e','ef4894f3-9573-4616-879a-7defb9eb2806','1','Expansion',NULL,NULL), +('f5af1861-a476-42e2-b9eb-0fc064f4952c',NULL,'77815620-a22e-4897-86ac-b37c319f21c6','e83944fd-b65b-4e2a-b7f7-dda6f1fa84a5','1','Expansion',NULL,NULL), +('f6b25499-227a-44b2-8952-23d72ea2b074',NULL,'4b718741-92d8-4c6e-920f-9a65da502b11','2b7d163f-3dce-454c-ad2a-8cc7ed0e8cda','3','Expansion',NULL,NULL), +('f6e6e032-fc9c-4f75-a82c-f00b6a6e9cfa',NULL,'5596de5c-2301-4764-b650-2dac0af3f513','1798fe1b-64ba-4845-bfe9-0996bb573f6c','2','Expansion',NULL,NULL), +('fa3ecc0e-a334-4ffc-8e30-250411c6833b',NULL,'c3eb5880-1370-4f47-8cdc-72a539782c63','f961726a-0fa2-4a68-805b-65c8421efc6c','1','Expansion',NULL,NULL), +('faee0036-4c4f-4c55-b3ca-3533a18439f7',NULL,'7185d525-31dd-4a6f-8a01-caec089b133e','c690c595-3d05-454e-8a17-3124ff0dc055','3','Expansion',NULL,NULL), +('fb323bb6-bff2-4178-b089-9100261acc47',NULL,'eb5a1e09-7f46-4f1c-ab7a-b017bad95261','fa1c8558-006c-4fb6-82f2-4fc0646d6b06','1','Expansion',NULL,NULL), +('fc3adc7e-e74e-4727-86b2-988a4143446b',NULL,'2fb28e79-e6f2-4cdd-832d-f191244207e5','04854ad3-6b53-4f04-a14a-6f68a839b62c','1','Expansion',NULL,NULL), +('fcb1d58d-953b-4e21-a522-6489c7b3c3c9',NULL,'eb5a1e09-7f46-4f1c-ab7a-b017bad95261','fa1c8558-006c-4fb6-82f2-4fc0646d6b06','1','Expansion',NULL,NULL), +('fcd524bc-35cf-4587-8d2a-7d3ecb20b467',NULL,'7628605b-bf63-49ae-9167-bde09df73166','060d3229-d944-4f58-94c4-3e29d2182abb','2','Expansion',NULL,NULL), +('fd5d4f10-4e04-41fc-a925-9121006ac6c1',NULL,'2c75b340-1bf6-4b0a-9fca-a488e8590149','ebef4326-e84a-49ea-9b51-32d4c35f4cb4','2','Expansion',NULL,NULL), +('fe3ca454-10a5-418b-af62-a5044613faeb',NULL,'f2e8f36d-351e-45bf-9a23-7a91dc5a2c8b','f82cb12c-b241-428b-adb0-efff001f9361','2','Base',NULL,NULL), +('ff3b54db-f9ec-4e23-bdf8-030ebf52b23d',NULL,'e0297a51-c670-452e-b31c-c5b37c6ad40f','6f09e053-56a6-4fbb-8299-e1de616825cc','3','Expansion',NULL,NULL), +('ff5f5ce3-1134-481a-8ba7-922d169c5c35',NULL,'14483a47-6f48-4489-b420-bb67b5006d2b','bacade2c-25a8-4b74-8e65-92c049a1b896','2','Base',NULL,NULL), +('ff6d9d46-cbf3-403d-b31c-746a044c54d6',NULL,'5d74727d-c270-4ff4-98ee-cadf2d70f25c','421007cd-26ed-4a20-b740-f7a72bc86aa7','1','Expansion',NULL,NULL), +('vnfapi-001',NULL,'vnfapi-invariant-001','001','v1','TestVnf',2,'Y'); + +INSERT INTO VFC_MODEL VALUES ('0062f5d9-eee4-4660-b08b-b1c63500b6ec',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0063a07b-6eb7-4ed0-a0fd-5a2877cf1b11',NULL,'629e5ac3-c75d-475f-8262-f53f6f761c2f','dec80f28-f12d-4ade-be99-d3ebf7635ecd','1.0',NULL,NULL,NULL,'virc_cc','virc_cc','virc_cc',NULL,NULL,NULL,NULL,NULL,NULL), +('00b2ed93-e2c8-468b-aa39-bd77a2f3e4ac',NULL,'aa2c90ad-56a3-417e-bfac-a16d52855861','a053db31-b6e6-4268-9d64-f3f26f630671','1.0',NULL,NULL,NULL,'schemamanager','schemamanager','schemamanager',NULL,NULL,NULL,NULL,NULL,NULL), +('0137c30b-93c3-49cd-ac2b-eff8eeaae0c9',NULL,'48ecf111-2b9a-491b-9a25-55fb39117ea0','ef7ad35d-0f5f-4016-900a-51ed005ca693','1.0',NULL,NULL,NULL,'cognosccm','cognosccm','cognosccm',NULL,NULL,NULL,NULL,NULL,NULL), +('0142d2b6-d79d-459e-a414-4a68e18d554c',NULL,'d8e95546-60f7-4d74-9bc3-97326e57f9bf','d003593a-de80-4202-9a80-bc5338c679c4','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'nd.c4r8d0',NULL,NULL,NULL,NULL), +('014a9370-210a-491e-badb-2831f7ebc6d1',NULL,'c9b52c32-2e53-47f5-9250-650d5380764f','33befda2-c9fc-4b49-9202-393fb8130277','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('01984773-9b8c-4a9e-ac78-7a6715abea41',NULL,'94a6c3d9-fda8-435a-9e77-4eff0258b7d6','117022fd-d404-4d61-8d33-9fe539702eed','1.0',NULL,NULL,NULL,'nems_be','nems_be','nems_be',NULL,NULL,NULL,NULL,NULL,NULL), +('019ee7d6-97f0-41c1-a9c8-ce753223c258',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('01eb2ef8-2331-4a95-bfe1-d3e4dad3cd4f',NULL,'81edb46d-046e-4011-81b4-35abe397885f','cfea6434-95f5-4de2-9823-4615e00f1aba','1.0',NULL,NULL,NULL,'plt','plt','plt',NULL,NULL,NULL,NULL,NULL,NULL), +('037cd524-4b26-4609-8fd0-3aa61ed1a2e2',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('03993dc2-e8ae-4b48-a5d9-33811fe820dc',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('03a5b04e-ebb1-4d2e-bc69-d4f88706086b',NULL,'dd05c4b4-e316-4dfe-8299-e80171bf48b8','9fa396db-273d-4fc2-90f7-05462023c744','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('04080672-2d81-4f9d-a58f-78d4380d9a18',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0447d25b-a3e3-4c51-809b-81a55b052bd4',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0448c405-43f6-4514-8ce7-57f46ec47f55',NULL,'7d603e14-9f59-4948-964d-df8bbccdc467','04d01856-ae41-487a-9919-b309a95309ae','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('0471e477-09c1-43e2-a26a-7839d81475ee',NULL,'1f00292a-0da3-4862-82c2-a606f9e2bf9a','ffa107f2-20ea-4264-8aa0-34a4dcd9e33c','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('0533df13-256d-4aa5-8123-3ed4cd067a00',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0540f0aa-408e-414e-a00f-f5fc603edaef',NULL,'9cef0352-fbe0-47df-87d5-62ed44ba5608','d2990b48-bc98-492f-b5cc-963db16b5ee9','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('0561ec40-601c-41bb-bce5-04feae250e09',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('05d29ec2-ac26-4b6f-9687-9898c6c18910',NULL,'facde21f-6dfe-47d1-beb5-003fae6a0651','462efc3d-a1ca-4925-a982-1dbd8d3dfbaa','1.0',NULL,'Y',NULL,'msrp_msc_b','msrp_msc_b','msrp_msc_b',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('05d36951-3d07-4255-8058-5bfc65b62d38',NULL,'1ba0abe4-897c-4d22-a039-b6af2fea476b','f00fb687-7cdf-4fe7-aaf9-3836c793ffaa','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('05fda582-6802-4e21-ba32-610c7fb1d1b8',NULL,'55372be2-6074-4793-92b1-e0fe1afb08b7','d03e16a8-becc-435b-aacd-829f6e3150b3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('063ed102-0d00-4cff-8bff-880ed09ad584',NULL,'5fb94500-7c25-4e41-86e3-87e11738a997','67079eb1-9fe6-4731-955c-e737ac75be56','1.0',NULL,NULL,NULL,'rpmrepository','rpmrepository','rpmrepository',NULL,NULL,NULL,NULL,NULL,NULL), +('069ef0e7-87d0-439e-846f-097c5d64a94d',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('06a1d072-4752-48c8-9c52-dfdd4c09c9e1',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('06eb1491-11fb-4e2c-80ed-5f4ad8b83b18',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('06f49ac5-7025-4737-bc0d-880371539b49',NULL,'0a288050-1f71-4ccf-8661-316720483150','8ef01225-7484-4d8c-bd31-b7d45c4c8bec','1.0',NULL,NULL,NULL,'qtracelb','qtracelb','qtracelb',NULL,NULL,NULL,NULL,NULL,NULL), +('071a1959-8203-4e9d-8c2f-d3dd67076353',NULL,'1acc9e6a-8984-4cc5-8d72-3bfb793ed325','83fd2e6e-3c8f-478f-a940-0bf3913d2cf6','1.0',NULL,NULL,NULL,NULL,'vdbe_node','vdbe_node',NULL,NULL,NULL,NULL,NULL,NULL), +('078e0007-2e68-4472-9506-d5910e167fa2',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('079379c5-41fa-4acb-b058-dd762213f48c',NULL,'d8ae042a-d48f-4d1c-963f-b928f9c5dded','b4ac350f-d421-4d7e-a45f-44f0b3dde082','1.0',NULL,NULL,NULL,'mmsc','mmsc','mmsc',NULL,NULL,NULL,NULL,NULL,NULL), +('07be8d64-8e5a-4de6-96e7-41782560df6a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('08372faa-bc18-4211-9fd3-19e3841ddc94',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0863ccbd-cfdf-4f71-b8ef-e37a045aef7b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('08f086e2-a710-42e1-944d-ac8fa4118040',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('08f2b087-4b49-41ff-b4f5-a36c6d2cd92e',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0a2882a0-eb50-4c05-a99b-97b6f4308620',NULL,'6af6139f-fdad-4b92-a60c-1e121b05bcaf','8c85080c-5e9a-44ab-9a50-e2f7347abaec','1.0',NULL,'Y',NULL,'uir','uir','uir',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('0a941339-667f-49b7-bf71-58f952cecbb8',NULL,'cfc8c02a-5018-4b58-8216-87dd38c72bfa','edd9bea9-efe1-4c15-a415-f7ddc83d4bd1','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('0abe9a8d-2437-4d82-92e5-d8190a8e2240',NULL,'8dd6d443-245e-4836-b008-cffdd1ed7f92','9db9362c-0fbd-4621-ab74-6571903dcd8a','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('0b390d3f-7089-45c9-8726-c69bdb7ee963',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0b552ace-2f72-4d78-8adc-3f6e7032dcf2',NULL,'6e0975ad-7f9a-4dfb-b4b9-0bc7f42dc8b2','0f294f57-03d6-4348-83ae-4ede8f9430ec','1.0',NULL,NULL,NULL,'processing','processing','processing',NULL,NULL,NULL,NULL,NULL,NULL), +('0bc31a69-5e59-492c-a40b-e954d98b0809',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0bc7260b-0572-4a47-bd84-b7bdb549a64c',NULL,'47efe716-c94d-4d1e-9739-d90a0110f62a','418c85aa-4f64-4cad-a106-c22bcee7316e','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('0cd419ed-508f-4dc6-bcd7-a18787161255',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0d5f6296-2725-4ddf-a5f5-4ec2b2bfa2fe',NULL,'6f46fe0c-e467-413f-98c6-45aef5b7e33f','5a0d5695-bd83-423d-b9a2-c241528ecb89','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('0d9e290a-d6ad-4211-a11d-18b4792297f9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0dd132b5-f92e-4171-98ab-f22fb7695ba0',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0f284f86-fddf-49c3-9a33-bf0ede0a361d',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('0f34a065-f043-401f-b0ef-d33dd77eb1e4',NULL,'788edb40-2174-4722-8756-9c61b20484ec','e98433e9-6ca5-436d-aa17-4d7385ed99ec','1.0',NULL,NULL,NULL,'rdn','rdn','rdn',NULL,NULL,NULL,NULL,NULL,NULL), +('0f4ca5e1-0f10-4550-a815-4f1a7ce05c32',NULL,'feb4bb3b-accc-4396-8649-0898f4863d33','203caf20-132f-406b-95b0-ef8a35112dcc','1.0',NULL,NULL,NULL,'pcm','pcm','pcm',NULL,NULL,NULL,NULL,NULL,NULL), +('0f61f955-e80d-43a4-8ce1-b74193595e95',NULL,'e33903e2-7bc2-4393-b185-87f5907539f2','47157d39-6286-4037-88e5-2f616ff751bf','1.0',NULL,'Y',NULL,'pcm','pcm','pcm','NIMBUS_PCRF_11.0.0Base-ATTM1.0.0.qcow2','nv.c8r12d100',NULL,'{ecomp_generated_naming=true}',0,NULL), +('0f6f72f5-c86c-4b79-988b-4c0b5f18ce9a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1','yaml','inv-uuid','fe6985cd-ea33-3346-ac12-ab1214812345','version','policy','Y',NULL,'naming-code-1','vm-type-1','vm-type-tag-1',NULL,NULL,NULL,NULL,NULL,NULL), +('10dc2bc5-8ab4-4477-930c-c6796781efd3',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1139adfd-89e7-4f25-95a3-1c600ff48e59',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('113b3b51-2d7d-4c1c-bffd-cef0a2c56035',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('11955383-eca3-4375-b8ee-07897373db19',NULL,'0a83b10f-8eea-498a-83f3-7df8780a8f68','8a74fa52-ab11-414a-92e2-5908d72f405a','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('119ec191-89dc-492c-a713-fb45f5364cbb',NULL,'99fe50cc-cadf-403f-a959-f481234a167c','2f95d643-f250-422a-9dcc-1b3c3f732525','1.0',NULL,'Y',NULL,'fe','fe','fe',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('11e735ff-de23-4a31-8e8c-c8af0cc37ed9',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('11e7e845-7975-4e03-9eb1-b61c8a37f361',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('12375bce-022c-4842-9321-dfedcf42a359',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('12b65d89-eaf3-4353-9810-d9d0848539e0',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('130faa79-9b52-456c-b21c-ad45c8bb9db4',NULL,'18f47678-e346-4149-96fb-ebe50cda4f04','63cd6a88-45fc-4da0-b118-91641b9a2a9c','1.0',NULL,NULL,NULL,'TEST_server','TEST_server','TEST_server',NULL,NULL,NULL,NULL,NULL,NULL), +('134626fe-118d-426a-82d3-fb0619fbc475',NULL,'74cb4bec-db68-4888-9c40-5e26776541ef','c1ce217b-343f-4d43-a7b3-95ac392aced0','1.0',NULL,NULL,NULL,'cm','cm','cm',NULL,NULL,NULL,NULL,NULL,NULL), +('13e3d5d9-dcf2-4a8d-bb66-5a2ea61f79ba',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('142e0921-694a-473e-b5b6-b974a4b5b0d2',NULL,'39fca8db-3cde-4c23-b61a-508c4d0641fd','23fd690c-ceac-4847-b61d-a4621ea834ad','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('14fdd90f-1dfc-4227-9c88-28e1ed111b34',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('153c72a6-3ad3-410e-b0e9-b2b6a4ffa66f',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('156f559f-0e61-4940-a0d4-d45639833b9d',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('157fccbd-2462-4370-bbb4-786c9b2e0815',NULL,'3ca34c00-47ad-407b-8b31-d209843f7a07','a6a47256-5dad-44bb-afd3-a3dcb58b6493','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('15a549ee-36fa-4775-9d22-e12cafb1cc22',NULL,'936ae33b-9cbc-429f-8517-6c540f884fef','19236636-177c-4ae5-b8bb-fcd5a29fefa5','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('16412ab7-109f-4c1f-beec-8a447255290d',NULL,'f596ba90-dab9-4be9-8002-e8ecd3906d5f','ab087889-fb19-4973-bb9e-2fd1c25be0b1','1.0',NULL,NULL,NULL,'cognos','cognos','cognos',NULL,NULL,NULL,NULL,NULL,NULL), +('1669c0c1-40ec-48dd-825e-ec50916968f0',NULL,'2bad24a8-c657-4b83-9418-86f2384b9b8e','dac6007d-c20b-46ed-8d7d-fa8fab319e4e','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('168fe2e1-4cd2-4d4a-b647-2045d10b878b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('16b581a8-30b8-4cf2-a199-70e0b1311c18',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('16b9c577-9176-4df4-8e74-39fce3c4ae92',NULL,'a334ea62-22d3-4b33-8cc0-c84b77344a30','8e01babb-d2c8-4e4d-bd63-e139c3549599','1.0',NULL,'Y',NULL,'ldap','ldap','ldap',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('16e20667-0700-4aa2-882d-cebdbe650ef1',NULL,'5a315346-8d3e-4a2a-b4ff-a466fe54366e','d1c62b46-7a23-49aa-81c1-574694a4f33e','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('16f679a4-35c3-4485-9ede-4042dfe1c201',NULL,'0cb480f6-dfbd-4af2-84b0-52b212694070','ec33342f-14ce-45b6-96d2-ac4403ade6f9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('17bd986c-d4ac-42dd-9618-0073427967a1',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('17e57524-24b7-4e8e-8425-3ebe49a04ca8',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('18981d0b-5d2c-4021-b7d3-a81f8beaa830',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('18ca2316-4d64-4295-8797-cc7599c0be17',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('19f675fc-c648-4a7f-94d9-f24fcb47bdc9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1a4909ab-73ee-4088-8cf6-45a99d076991',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1b8c9fc6-be3c-4570-81da-97e76a7bafbb',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1bf49c1e-80a7-4039-877b-79da95053258',NULL,'473fb54b-ed67-4725-b7e3-674e96c55649','37f1531b-a288-4c49-8c02-3ff17212c89e','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('1c0632cf-4a76-4b17-9194-b294dc1ed460',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1dd16655-f74c-4484-ada0-656484588424',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1ddb4d75-211c-418e-a50b-cd7242ecaa19',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1dfcaa44-2b6f-407c-aa6f-89d12c850a13',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1e262dce-063f-464a-87d6-f7d82910a1c7',NULL,'5818d233-caf4-4825-a7bb-144bbd731329','b8c28cad-e97a-4ee8-bc64-119b373cf98f','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1e3d921e-1df6-4bfa-9a94-939586fc9843',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1f57716e-b0a0-4e25-bf81-7b8c9c1a2593',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1fc481ad-15cc-4bff-8e32-d4c59bd4e2e6',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','7f26a2f8-3e6f-463d-8d7d-2a8fc36b2935','11.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('1fdb9130-1cf4-4c50-b72c-3379e4cf0efe',NULL,'bfc3b33b-6bac-49ef-8d48-f732937bb75c','3d9006dc-21b9-4ce8-924c-053757611565','1.0',NULL,'Y',NULL,'msrp_msc_a','msrp_msc_a','msrp_msc_a',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('2','yaml','inv-uuid','fe6985cd-ea33-3346-ac12-ab1214812345','version','policy','Y',NULL,'naming-code-1','vm-type-1','vm-type-tag-1',NULL,NULL,NULL,NULL,NULL,NULL), +('20111295-e578-4039-9adb-5a8443a8a86c',NULL,'8a8a0fb6-8a01-492c-b131-a6894f41cc74','f57ee0f6-6f98-4ec9-8b04-b03fe0bf6f21','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('202e7744-8c3c-4915-b654-15488c602bd9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('20449785-a2f2-4c89-858f-b22a27835136',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('20b7262a-15c4-4644-8ebe-7921d6c18123',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('20bd05dc-f26b-49c7-8738-f4109b1177d4',NULL,'1b9d7f98-60f9-476a-bd30-dc200fa89f93','0318d0e9-d938-4c4a-9157-848e5564f717','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2153c384-b814-4630-8756-e1477228dcb4',NULL,'779329c0-9056-4e55-a2bc-4512268f462e','cd30fe8f-6a81-4b02-89c9-38f463a58e3d','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('2262746d-fac4-490f-8866-a540a6058cbf',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2296b1d8-a70c-479e-b8b8-b8a7de9ef44b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('22d1c351-6d11-4184-81ac-af81d4de101c',NULL,'2b60f774-37ee-4121-b28a-8883b20a0fb8','f028b735-c52b-42a7-ad34-bc51d14037ad','1.0',NULL,NULL,NULL,'d2ice','d2ice','d2ice',NULL,NULL,NULL,NULL,NULL,NULL), +('23b0fda7-3008-41df-a3c0-b25dd54a3f77',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('240d4bc3-8350-4882-abc6-efa6d477fbff',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('244632dd-0eaf-481e-ac16-3c6952434b7b',NULL,'af6d9190-974e-4227-86df-ffd517887f61','f69d1c42-f423-4e8d-90c8-afee2f435651','1.0',NULL,NULL,NULL,'TEST_server','TEST_server','TEST_server',NULL,NULL,NULL,NULL,NULL,NULL), +('2461f70b-edaa-487d-8bab-1646c4f24515',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('256c73d2-1aaf-49fb-82a9-c5236f139e9c',NULL,'e2a1695a-4738-45a1-95fb-6b9876d72989','64eb97fe-401b-44b1-94c6-890e017ba2f9','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('25d55f9e-a84c-49d7-89cf-7a8c8eea8bae',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('260143db-a9ff-4415-bfb0-c35a7b7063af',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('262cbb0f-c6d4-4cf0-9281-1f53c8ffdbc3',NULL,'4f452541-6af0-42b1-b297-c8f308475a56','dc573479-521a-4ad5-8b6f-8c13b87fc091','1.0',NULL,NULL,NULL,NULL,'vdbe_node','vdbe_node',NULL,NULL,NULL,NULL,NULL,NULL), +('269a1dc1-96f2-4b0b-a8d6-0b322cd1f7b0',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('26c479ff-a252-4510-950c-e8ec996e4f0c',NULL,'16646ff5-a6e1-4ffe-b865-0b60d651a858','823ab43d-b194-43f8-8b02-2146f4b6092e','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('27bdc15a-5ed4-4529-97ee-0c1960e5528c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('27f4e949-3263-45d3-a592-20eb8492556c',NULL,'8e15b51a-5e4d-48bb-8c09-d7a8949ca333','89678cef-a1b3-4844-beba-4b2c4a34e132','1.0',NULL,NULL,NULL,'qloader','qloader','qloader',NULL,NULL,NULL,NULL,NULL,NULL), +('27fde274-45f9-499d-9d7e-7a9196c680b2',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('281f4841-4a67-40a8-ba1d-c1971f82ffb7',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('284c3ef2-99b1-45c8-a5f7-14e33ee08676',NULL,'a8f2f314-d7a8-41f3-9752-a6b22fb15a57','e49cf9e1-a63a-4f9d-9825-06c2661bd33c','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('28ed6793-760d-4b33-bf48-367adcbe26fa',NULL,'51eec557-e371-4af9-b6ab-d09e7ca5d904','13cf44eb-7dae-48e5-bbee-e8b3bf26e9ef','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('299426a1-ece5-4fbe-b449-2cfaa1788c98',NULL,'fd2c7c18-aa25-43c6-940d-f496d8e0d3d8','be447d18-0340-4f9c-937f-d742dc8b961e','1.0',NULL,NULL,NULL,'pd_server','pd_server','pd_server',NULL,NULL,NULL,NULL,NULL,NULL), +('29f53689-0d3d-431b-99cc-57fc002f5baf',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2a811181-e613-4ec8-95d2-893d4007cbb9',NULL,'1f3512c6-94f4-4609-905e-267e95addf83','4696c1b5-3781-4413-b3b0-14082a51da0b','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('2b480094-9d68-4a65-966d-af1d89349143',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2ba8635a-b069-4787-910a-9b57043244ab',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2c5c862d-8e31-4559-bf66-4a396e847b2b',NULL,'4363ec32-ac12-46b5-a681-da39c9b937ab','071040aa-79e1-4451-b0f5-582e8e59efda','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('2dce2d53-9cd0-40c8-87c7-4318165c4016',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2deb1937-f627-42ea-97d7-ea6df8f525c1',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2e708833-1f3d-4653-a0bc-5328b73bbbf6',NULL,'0cb480f6-dfbd-4af2-84b0-52b212694070','ec33342f-14ce-45b6-96d2-ac4403ade6f9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2ea04d4a-84ce-4641-a879-544477584f72',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2ea978ac-2761-424b-af1f-c0707ccdbfb1',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2f381c15-0fe9-4c88-99b7-5e2f165a38db',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2f6e792a-63b3-45a4-b9ae-cc38b4301bb2',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('2fc889a4-d5a0-46b9-a502-6411db0c4a1c',NULL,'f2c4a5c4-d809-4d19-9c02-308b34e89794','65d44361-202b-4aeb-bf5d-ba318fc1f34d','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('30145f1d-140a-452b-95c9-0530a5ece13d',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) , +('3018cfbc-fa08-4dbb-b2a1-195267d79b1e',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('303059e0-a0b5-463d-8e96-5c85ff0cfc46',NULL,'686d2704-0892-41aa-8b79-b7360fe6903e','e4ac3c72-2437-48fd-907b-6418b691f798','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('30c35db4-9682-4f55-92d4-142079dbc5a1',NULL,'10421357-a2b3-4a7a-b82d-125b2805fa5a','56324cee-8dfd-48f3-aae8-3101be93cdac','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('30c7d426-fd01-4ab1-9a87-3c53bcd23d88',NULL,'05814c22-d7bb-4d14-93ba-d2079f2666e7','84bb300f-48cd-461d-82a8-f24b0e54cb3f','1.0',NULL,NULL,NULL,'iox','iox','iox',NULL,NULL,NULL,NULL,NULL,NULL), +('312a26bc-b721-4ed5-a402-be0e502c675b',NULL,'8d5acbcc-77b0-43ee-9775-8f4cd8fdf949','b50b4639-baf7-4472-9acc-fb576bc007e1','1.0',NULL,'Y',NULL,'xsa','xsa','xsa',NULL,'nd.c4r8d0',NULL,'{ecomp_generated_naming=true}',0,NULL), +('31608b19-4efc-4620-a248-61147f9ec8a9',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('32365da5-1a59-424d-8397-4fbce1bae4fa',NULL,'dd03d850-e91b-4ed0-bde4-0e721e76d013','1ee5d912-91db-46cc-9735-0b14d9463f7f','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('32b1b5a1-e05d-447d-a5ff-9c247bfdbc72',NULL,'d94bdc77-144f-4b50-a351-aea5cbc9de4f','d81064dc-bf74-44c5-afcc-e17916a915d1','1.0',NULL,NULL,NULL,'cm','cm','cm',NULL,NULL,NULL,NULL,NULL,NULL), +('3303c8ea-2e16-4a3f-96b7-fa98132560e6',NULL,'196c64ee-ec75-445f-990e-08c6c9635298','16da0427-b36f-40ea-bb63-a68bf9a84272','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('332fff76-b67a-4970-82e9-4e6db5fc0e36',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('334add61-2118-4e75-8db3-5674849b5320',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('33d693e1-61cc-4517-9eec-56fb0572c93f',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('348e928a-e3d1-4faa-ac35-a1e2d6768fee',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('356e5394-90ca-4dfc-8ade-529077b727e4',NULL,'55372be2-6074-4793-92b1-e0fe1afb08b7','d03e16a8-becc-435b-aacd-829f6e3150b3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('35726559-7135-405b-9691-47ed50bcbc19',NULL,'55ef56c6-5f0b-420e-a787-64944a746d89','99e3482a-d42a-4ffe-aeb7-9e9ada03c8e7','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('358b84ab-f1af-4c42-8c81-c92801eff167',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('36102a1b-ce2c-46b9-967f-30318db23a32',NULL,'0d54acdb-fefc-4d60-a429-ef351dc2a1f5','a10ddd8c-4366-4394-8854-6bf7b0d0014b','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('3665d859-180a-4314-beac-8f1877f2697e',NULL,'9645e0f8-e537-4f9d-b137-8d16251f7138','4ff38825-5106-43de-971b-90b46d2e4e26','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('36eea4ac-8f88-4323-942d-7446fbf9639a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('372ee369-1d49-4aa2-acc0-1ef806a4fc03',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('376d659d-528d-41f7-be51-39ef57834ec8',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3794aacd-6535-41c8-af1c-02e300ccf50b',NULL,'9c9a8369-9e89-431b-9e73-9d483b2cf7e4','8d2e734d-882e-4998-9c8b-413e2b9d1241','0.1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3827c05b-6c06-42c8-8725-b95353f97d9d',NULL,'27c16c65-2ecb-4c7f-bda2-96aeb31e5ae0','8e7dcc7d-9aab-4509-b3c9-81ef4cdb2ea5','1.0',NULL,'Y',NULL,'iox','iox','iox','USP_IECF-IO_30.3.3-mcas4.4.6.qcow2','nd.c4r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('3850fdff-11a8-40b8-8bc5-f589c42a6702',NULL,'60b620de-1ff3-46d3-9ae9-672b47ef0b27','75b70257-ee09-4481-965c-f3397849623c','1.0',NULL,'Y',NULL,'vmxvre','vmxvre','vmxvre',NULL,'ns.c1r16d32.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('38f47dc0-dc33-4375-98a9-0a9d37c9ad4c',NULL,'ce213aac-bfac-462f-804e-a33091598aad','d65d9977-6053-4fba-b75f-a2fa315cd9b8','1.0',NULL,'Y',NULL,'mmn','mmn','mmn',NULL,'{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('3982125d-dfc4-487f-862f-66e1e7f78d17',NULL,'b3bf2d8e-a28c-43a8-9d68-a08a39502faf','38b82ce2-7b45-4f4b-bb2c-bdaec51fc8a5','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('3a05ede5-360a-4f5a-8cad-072560dd4406',NULL,'1451a853-2fc7-4858-b1b4-72fe23395a6b','4a920796-cb97-4bd4-8724-c2e6155a86e4','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('3aba87d2-cc84-44fd-bc43-190d750f1e69',NULL,'55372be2-6074-4793-92b1-e0fe1afb08b7','d03e16a8-becc-435b-aacd-829f6e3150b3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3b1b59a6-d272-4ece-9dfb-ca87f0f793cc',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3bb96b94-bc38-47ef-8202-f4c1f4b27beb',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3bca6d26-d1c1-4ec1-9bb0-92ac6ec98dc0',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','7f26a2f8-3e6f-463d-8d7d-2a8fc36b2935','11.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3c0ebca7-bfe3-4a8e-8167-93a7878c9bef',NULL,'07e7ca7e-fca2-4131-a73e-51884ac6f4a6','6618af0c-d1e5-4813-ba39-228f2ad99128','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('3cdfd81c-3bb5-424a-af61-ae38a0131317',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3ce98db0-0653-4d31-b065-a61a1959ac5f',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3ce99b7c-9515-48fe-bb98-62f22f2fb005',NULL,'5ec38b95-96cd-4cb1-b90a-484f4b13bd1a','c1374c40-adeb-4371-9d71-209c0315aef8','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('3d1957d7-1eb4-4df6-8469-74bccd0bd11e',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3d370a1a-2529-4c8b-be72-e4bf088c8e8a',NULL,'e6645581-0cc6-4e7d-a4dc-42124c8e364c','4b91bd36-feea-4a40-8304-609285032caa','1.0',NULL,NULL,NULL,'rdn','rdn','rdn',NULL,NULL,NULL,NULL,NULL,NULL), +('3d8d3b5d-9c34-415b-8c74-7f0a9c7bda51',NULL,'ced31a1e-b4ad-4fbf-aefc-1a3701f16bc4','b302fc76-1708-4ef9-a217-231620ab4154','1.0',NULL,NULL,NULL,'nems_fe','nems_fe','nems_fe',NULL,NULL,NULL,NULL,NULL,NULL), +('3e3471fb-6ca1-49a2-abe6-40e7a864f767',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3e37923b-b8cb-498c-938f-a19449908f52',NULL,'bb8ff02b-6404-4e81-96e7-33999ed0fff3','62c39097-93b8-4d9b-9fa2-6c3e0d36d729','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('3f777214-6a28-459c-962d-8ae02f45da94',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('3fe28b6e-6631-463e-8044-5062f2ab133c',NULL,'39b2008a-1fd8-4af5-90cd-5bf098bd1123','ad7c0ec9-fddf-42d6-8c21-999a83ea0eb5','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('40183eae-faec-4e45-bfd2-c16565cbc034',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('40821124-8d95-4f55-91e2-608e72ffe6d6',NULL,'21d87e48-2aa9-4f8d-9daf-268b31363a31','35a3e997-8208-4040-a4b3-0a6d39e198cd','1.0',NULL,NULL,NULL,'mmsc','mmsc','mmsc',NULL,NULL,NULL,NULL,NULL,NULL), +('40a486a0-8420-4d2e-b2b9-fdd5d757f60c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('41185191-dbed-4382-a9ae-f0e847fec9ff',NULL,'83429bf9-49f1-4187-a5ad-afc329a84e76','ce422e74-7e58-4464-8a54-61e21f3ca7e5','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('41d27492-bfe6-4588-8f7f-d280636b667e',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('41e0211b-d990-4d09-845b-b98c9bed3f07',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('41fb28aa-44f9-48ee-9bb2-d4db999ea4b6',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4209ff94-bb09-4a7e-a8cd-ef7691d20faa',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4258c5c9-19f8-4942-a820-db7a646d9310',NULL,'c5eaa410-5dcb-481e-88a4-44434fc9c58c','c3b635e7-4bcb-4537-b1c2-edc9ca45ac3b','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('428b0e01-a072-4d21-924e-2f692fec7277',NULL,'7a1a7790-bbcd-4aa3-9c84-345ca1c4b52b','ffcfccb9-8813-4d8a-9f29-a6cb4dd4e754','1.0',NULL,'Y',NULL,'plt','plt','plt','USP_IECF-PILOT_30.3.3-mcas4.4.6.qcow2','nd.c2r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('42ab4b8a-5046-4b5b-bfff-8503dc43f257',NULL,'1dde5066-ec47-470d-ac78-f741f61885ec','0ec3151a-dab9-48ae-89e8-f1a88b73fbf6','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('431f242c-8b94-4f4e-873b-6546f1ed60a1',NULL,'f2d2ffde-5ed8-44ae-9471-f8bc0a51a89f','0b882f5f-b364-4603-85b5-e8cc94a11fe0','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('437d3bd7-2fff-4642-8a87-5396aa90128b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('449e1e81-848e-45f7-a1f0-14aa9bde238b',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('457d2c5f-1899-43b0-85b3-caf5866a6065',NULL,'eaba5eb8-c480-47dc-b046-9ac6fc886077','aa524dcd-f38a-4f07-8288-af7cb10569d7','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('466c9e3c-6a64-4ae8-8900-07dd5f2f1473',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4682caca-c19b-4f1e-a8c2-b68ac4fc9c5f',NULL,'5a315346-8d3e-4a2a-b4ff-a466fe54366e','d1c62b46-7a23-49aa-81c1-574694a4f33e','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('46e79c61-9476-43b3-b1ee-7b39c8569531',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('46e86198-aec6-4036-b38e-c1cbd3e7e349',NULL,'223edb5e-cdb3-4a32-97d0-46bb57c99ad7','bf3c23e2-0ee4-4e4a-a7c5-e0e6b6625706','1.0',NULL,NULL,NULL,'pps','pps','pps',NULL,NULL,NULL,NULL,NULL,NULL), +('4858ced6-3fe9-4803-91ee-a10a69239496',NULL,'16ecac80-118e-4826-bc18-9bd527126b7e','b3e8dc25-ba0e-4ba6-b301-b66a05043040','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('48e45c5d-e7b0-4dfb-9d40-40d122ad1c44',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('49036c1a-217e-405d-bf5e-08c9a46d57d7',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('49414e75-93e9-4f8f-bc79-49b6655bd4e5',NULL,'230bf8f6-f204-450a-af6d-9cc65fea4f76','7c19492b-dc31-4319-8213-7b9ff791d314','1.0',NULL,NULL,NULL,'rdn','rdn','rdn',NULL,NULL,NULL,NULL,NULL,NULL), +('4aa42ecd-6cb4-4759-8fd3-6c2fae4a2034',NULL,'179a86ce-e6b0-463c-bd4b-03595729976a','f18ee363-2b6f-4408-8a93-1dd8ab5ffb42','1.0','nfc.naming.policy.robin',NULL,NULL,'nfc.naming.code.robin','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('4b922450-c9a6-4533-9d24-92f1b1f84160',NULL,'80ebc47e-1f35-4ab8-a36d-2328a4a6985b','d6a00b1f-e12c-4145-9842-0ef6fc4fd69a','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('4c0e88fe-b367-46c2-ad07-fe7a8cde6f30',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4c6c958d-b1b4-4aef-a768-0618a5650527',NULL,'583301de-2a2e-40cf-98bb-3018be595871','26eaff4c-c6e0-41ee-b02e-27cc1208ed73','1.0',NULL,NULL,NULL,'configurationrepository','configurationrepository','configurationrepository',NULL,NULL,NULL,NULL,NULL,NULL), +('4cedb213-a6ed-443e-8f8e-67cef4c87e47',NULL,'58ce4658-3fcb-4b6d-a04e-43655908f50c','732be459-eaa5-4263-923e-21d46599740b','1.0',NULL,'Y',NULL,'ssc_b','ssc_b','ssc_b',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('4e09e0f7-6b42-41f5-b197-2ecfd4877987',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4e7f65c4-94aa-4826-b401-c7f75d7a5e97',NULL,'3bcaeab7-d987-4faa-abb6-0ca59f1ac661','4af66211-80b1-44b5-b68c-212c4921295f','1.0',NULL,NULL,NULL,'iox','iox','iox',NULL,NULL,NULL,NULL,NULL,NULL), +('4eb18412-12f7-480f-b232-5a4c4cb2fade',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4f2f5f08-8a0b-4828-be27-5ff1a641ed6a',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('4fa2c6e8-bd95-4440-af00-390e8fffebc5',NULL,'85bb6bc2-cd25-4bb2-98a4-28cc47d270cb','73717171-1684-4aea-acfd-7abc8533fec3','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('50432d50-169b-4592-93c7-7df340829872',NULL,'88404161-33c8-4225-9b11-934b2686b005','f3264aab-8f59-4942-a118-2663e445e055','1.0',NULL,'Y','Dev2DevNfcFunction','pd_server','pd_server','pd_server',NULL,NULL,'Dev2DevHighAvailability','{ecomp_generated_naming=true}',1,10), +('5051c268-7bb5-4d56-895f-8f829087025a',NULL,'b95401c8-5c5e-48b7-9839-d581cfca5935','4c671c7b-3ce5-48d6-b7ca-4047c3ebb2ef','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('50f47cdf-1c8b-4843-b331-94927f239a6d',NULL,'9c283f37-5516-427f-b230-37fc356852b6','95a81e90-cd52-4adb-a31a-957691fb11dc','1.0',NULL,NULL,NULL,'smp','smp','smp',NULL,NULL,NULL,NULL,NULL,NULL), +('5165ea8b-7460-4879-b6da-5a9bfc4380b8',NULL,'be545d42-bfa1-45c3-8c74-2febed777c45','4c5e5e35-19a6-4551-935e-44c6a4468b1e','1.0',NULL,'Y',NULL,'vmxvpfe','vmxvpfe','vmxvpfe',NULL,'ns.c20r24d25pin.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('518db694-1c7b-458c-abbe-b9676fdd68e0',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('51b414f7-8f44-42be-94bd-8e83c7bebb6e',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('51d4e18b-ee2b-4f40-8812-4904d310e500',NULL,'4ddeea35-c041-472a-853b-40b8974dd9ca','140b8590-3d21-474c-9cd2-72d71eae93ac','1.0',NULL,'Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('521d3ae4-ad2a-4479-8b47-2b8e2f265a8b',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('527637d4-3f1b-4453-8a73-63be37d3ff3f',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('542331c9-6001-4760-a7d6-c2946a68e5aa',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('54325dd2-d646-4f36-bb61-c1657771bbef',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5453e348-8c2a-4ae1-9c78-13861de6ae4f',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('54b6166f-1926-4542-899c-fb4aa0a3254b',NULL,'8a33e6d3-ba02-4004-a057-d8deefc6a217','1941965b-d36f-493c-90d9-cfe1085ac402','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('54d33de8-a3a3-48d4-9616-7976d894162a',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5543defe-8d08-4cde-badb-fc68eade5100',NULL,'e113d30a-8a62-492a-837f-735a4eb88db9','eb45f98e-31d1-4c8b-afca-7412defa9056','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('56079609-0b08-4307-8f61-2bb1545aed00',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('565090e4-6b5f-4690-8743-19cb7716fa8c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('565a8a1c-4ccc-49cb-a3dc-5f8f8ce72c51',NULL,'6b67203e-d718-4b4d-8fa5-3308b9d6d909','07ec6c1d-5336-403a-a41c-950cb68956f5','1.0',NULL,NULL,NULL,'prx','prx','prx',NULL,NULL,NULL,NULL,NULL,NULL), +('56f74777-a946-46d2-8ceb-c7f0d124894c',NULL,'c5f1a3b8-fd2a-4938-8ff3-734f6049d0b1','d522e5ca-5bb6-4e51-8ca6-99b59fd789ae','1.0',NULL,NULL,NULL,'iox','iox','iox',NULL,NULL,NULL,NULL,NULL,NULL), +('5790fb74-2ac3-4340-b69a-08bf3f3d126b',NULL,'1c2ec7cc-2558-40a9-a5de-23ccca42f2ed','2717a36a-1b5e-421b-8794-65c7a92763a1','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('57ce1650-9b4d-4a45-bee1-b4e841fadfbb',NULL,'dec68ab1-24f5-4d83-a37b-80c716bb4c31','bf2cab5b-a968-48bd-b4bc-65914bba461d','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('582e18c1-689b-4516-9855-7fab1a489b18',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('58cf0015-fdca-4c3f-98bb-53c863716fd4',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('59330f0e-f45f-4111-bf21-a4bed5d4b30d',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('59698c21-7013-4e48-9f7c-bc6f9ea2562a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('59817abe-bbed-4aeb-a1c1-5cb60b043543',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('59b22558-fa49-4c10-af6f-a38ba93fbc5c',NULL,'72308d7a-5d2b-43d0-ab9d-1839fae15b63','f2c093f3-2f6d-46dd-880d-2831569cdaa9','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('59cc25b6-e415-489e-aeab-e5edde982605',NULL,'d1167766-829f-4022-8592-2b0edfb6069e','184c9f75-7577-4996-afbc-1ccc5419e015','1.0',NULL,NULL,NULL,'smp','smp','smp',NULL,NULL,NULL,NULL,NULL,NULL), +('5a119889-9974-4a98-92d5-96a715f7c24a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5a661196-c961-4286-9198-564347fea738',NULL,'0d87f028-90dd-4b2d-8f76-87a4b4b55b64','d9d2dace-1ec5-496a-88f7-63dc218e1d99','1.0',NULL,NULL,NULL,'itc','itc','itc',NULL,NULL,NULL,NULL,NULL,NULL), +('5a6c9ad0-e611-4ef7-92db-b40e420b1cb7',NULL,'a181d0ff-11f8-4818-b98a-e14690db64cd','9baf379a-2c58-4788-9dcf-4a769dcd28a5','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('5a953500-41c9-43a1-bdab-48321b482c79',NULL,'c117b652-dc84-43b7-b30c-12b21891f47a','95d3013e-11b2-4bdf-97ba-6e4a5a7c4227','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('5aefee46-a414-488f-b648-cd02afaa7b02',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5b3263c1-71f0-4dcc-815c-9ebdfcb40a7f',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5b453243-b3cc-4177-a218-c722216fa867',NULL,'8cf7115b-cc5d-4143-b53b-96135982c0be','3aa0e405-eacf-4a54-b254-f95dd19a305b','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('5ce95a94-dbbc-4648-a7c3-deea7e7997aa',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5d160958-74af-4327-96d6-d4bebe5e0465',NULL,'23bfbe35-8d8e-469e-8da5-9d17dddef5a9','27daf0ce-39f6-4e3a-ae3c-d92bb253aa45','1.0',NULL,'Y',NULL,'sbc_a','sbc_a','sbc_a',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('5d2ec4aa-6e7f-4841-b67e-7b31a4e1858c',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5d9f98ca-8553-4dd0-98e8-a6fe6de2ec94',NULL,'744574d4-1102-4955-8e71-9ac4ab301bbf','08c98244-6d94-4c3a-852f-b3d05e371df1','1.0',NULL,NULL,NULL,'plt','plt','plt',NULL,NULL,NULL,NULL,NULL,NULL), +('5dc18cc5-64ee-4f43-ba4d-cc24a6305425',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5df465c0-9806-4790-8602-43ee2ffbf546',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5e482da4-33c4-4601-bae7-d4b05436e58a',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5e910229-fbc5-4347-910c-e293d63934f7',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5f309a70-35f3-4b2b-9f06-71c70b39f3a2',NULL,'cdb897e2-b3e0-4365-91d9-a603527fb52c','50148aff-51a7-4251-879d-54dd039086ae','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('5f859628-9f96-48a4-a2d7-a97c1148990f',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5fd8bde5-aa4a-4e3e-a9e3-f874eddc00f0',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('5fdc1d98-154f-4d04-9d09-5fcb40b8c0e3',NULL,'86093520-4a0a-4427-b1b7-1432a8ec0716','a8f3626b-bc8a-48fd-8c24-859943feed1c','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('6006ec20-3a36-4b3f-ab75-a1fcfd5147ea',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('605ae21e-0b6d-4cd0-93cb-393313b4bbd4',NULL,'c7d8fb73-f7c9-4dca-8c23-ddf11c84b8cb','ea5877e8-c188-4908-bc35-225bb4d4fb6c','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('60636dd9-1339-4711-b1bd-2c7de1e7791e',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('612f98b5-39cc-4cba-8424-d889d44c68cb',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6167622f-b602-416a-9bed-c38b157726f8',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('61c7a13d-8dbf-4ed8-b00b-728f48ffa8b7',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('625434ec-f721-4a37-a8cb-e0e901de4103',NULL,'7ff1b44a-41d3-469f-baf2-7f102d47feba','1d4f0506-bace-4fa5-b38b-3c31ae5e857c','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('62d977c1-b230-49b3-8be1-4b5872f5e3df',NULL,'629e5ac3-c75d-475f-8262-f53f6f761c2f','dec80f28-f12d-4ade-be99-d3ebf7635ecd','1.0',NULL,NULL,NULL,'virc_cc','virc_cc','virc_cc',NULL,NULL,NULL,NULL,NULL,NULL), +('634b1226-63e1-4a84-b9a1-e68a1403efa9',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6383c740-0dc8-4937-8c0f-70d77fe2ee17',NULL,'fd3d83d9-e375-4d27-ad44-99c84b5a5c26','eadafe4a-071c-4279-a898-d00d3dbda63d','1.0',NULL,'Y',NULL,'mts','mts','mts',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('63e225bc-c72e-42d0-95b4-9f9f77139c18',NULL,'00db22fa-171a-42b1-8292-c6029717cdac','42d0b694-64d5-4846-8ee0-c7a1d1531d50','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('64088775-2a93-41a5-bb53-3206f9c36afd',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('64fd6f6d-aa6d-40bd-a883-5b8960e0f64d',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6522a054-632b-419c-b88d-e56a1b5236ed',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('65794907-4255-48fa-b710-86a806e23e99',NULL,'b051c80d-d816-4c2d-a208-61410c68f6e2','81905a04-15f8-4f7a-8a24-3848cf419ee0','1.0',NULL,NULL,NULL,'iox','iox','iox',NULL,NULL,NULL,NULL,NULL,NULL), +('65ade596-5f15-4115-a3a3-e214cc95a129',NULL,'93b69c42-b5e8-44c6-a9ac-10ce60054dda','4659e19b-dec9-4ff7-a322-78ba480f1767','1.0',NULL,'Y',NULL,'ppd','ppd','ppd','NIMBUS_PCRF_11.0.0Base-ATTM1.0.0.qcow2','nv.c8r12d100',NULL,'{ecomp_generated_naming=true}',0,NULL), +('660e35c0-74cf-4c71-bc28-7bf9a769b5b9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('661515a7-71eb-4b65-9a67-4c3fe8915404',NULL,'d273feaf-7e39-45ab-8572-bf19f546b06b','f7001d42-6a1e-4ca6-a82c-b075f6981d93','1.0',NULL,NULL,NULL,'pd_server','pd_server','pd_server',NULL,NULL,NULL,NULL,NULL,NULL), +('66518250-5925-45ac-bcf4-086bb8656b66',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('667b77ee-a50b-4889-9c7d-46d8cb934a63',NULL,'16646ff5-a6e1-4ffe-b865-0b60d651a858','823ab43d-b194-43f8-8b02-2146f4b6092e','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6738c484-287c-4ecf-8095-0e38f0691482',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('677cf9d5-c18b-4fc5-a36c-4324dbcf3852',NULL,'59f360ec-d2ba-4b27-aeb0-d35618afcb76','890f9c2c-828e-49e2-9c20-b2a77355149e','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('6784843b-6ee2-4ea9-9245-2a9400ab9288',NULL,'c9945dc9-208e-48d3-a482-96925abe89e9','f2f35403-065e-489b-8b9a-c5c46dd76825','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('6835d254-f980-4d84-b997-f2437090fd3d',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('68386bcb-a633-4732-9777-7b997a448e5e',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('686bdd0b-788e-4744-9e7f-32869db281ce',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6873c4ae-14a8-4ecd-9c04-24e20eb2542c',NULL,'117e6aac-885f-4ff8-891b-8e2696ce4964','1de8217a-db29-45e5-9f43-2edc6c9d85d2','1.0',NULL,'Y',NULL,'vmxvpfe','vmxvpfe','vmxvpfe',NULL,'ns.c20r16d25.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('68d5f2b0-5ad7-488e-9803-43aeeab09759',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('694b2e6d-83ba-43e2-b405-d947e94dda5e',NULL,'c3ecc32f-38c9-4583-a513-4a8b65b21a83','dca61bcd-2102-4003-b433-9b7a9d01dd90','1.0',NULL,NULL,NULL,'pps','pps','pps',NULL,NULL,NULL,NULL,NULL,NULL), +('69a32834-078e-48c3-8bd9-3125da2489b0',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('69d27369-08ed-4765-a489-968e1fafadd7',NULL,'c91280dd-70e8-4ba6-a477-810629137b3a','f338dc0b-5575-4c38-b7e1-a9d40010de27','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('6a44b6b2-f7fb-4e2e-b8a1-e1342275b86a',NULL,'5b7dd098-162f-4424-952e-cd0a0cd39447','87cc7625-fc88-4fb5-98c4-be288c1cc25a','1.0',NULL,NULL,NULL,'TEST_server','TEST_server','TEST_server',NULL,NULL,NULL,NULL,NULL,NULL), +('6a6754c1-9f43-4cf1-92f3-044b6147ddac',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6ac5b9e8-f995-4d12-bbcf-d76ba61ae8b3',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6aee8f5d-b063-4564-813a-8b671a3c5f97',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6b1675cf-f93e-428f-80e3-5ec838c73324',NULL,'554d02b7-0922-42f1-b0ad-1acc91f1380d','920984a2-1ac6-4e29-b566-5a10a72c51d9','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('6b8f77a4-c715-4a2d-92d7-d8a96bddeea8',NULL,'55372be2-6074-4793-92b1-e0fe1afb08b7','d03e16a8-becc-435b-aacd-829f6e3150b3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6b9dff87-0c04-4a10-a918-9b627e9ae0b1',NULL,'2972ce9f-526f-471f-aabf-df99168287c4','f2609a4e-8bc3-4659-bef6-bf77667b37ca','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('6bbd2dc5-5272-4012-a92f-f51387e1bed4',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6c227dc7-acf3-41e3-9d0a-7aded6164c33',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6cb2be72-7210-492e-9f4c-4647b54d6613',NULL,'b0444e96-4474-47b8-947f-65bc6d95e9e4','b7e37bdf-728a-4411-9fae-d1f789de3004','1.0',NULL,NULL,NULL,'vth','vth','vth',NULL,NULL,NULL,NULL,NULL,NULL), +('6cf1a3b9-ef74-49e3-b682-34e57f79e22a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6cfdeef0-8962-4d62-83a1-b11020d72aeb',NULL,'11aa3eb9-b80e-42d9-b2f9-378e4da35112','ef6656e8-3029-4125-8d06-747429518439','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6d810590-688b-4419-aa25-04f0127a8286',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6e5b8879-0cba-4804-b80c-85004fb8c3ef',NULL,'cb6c8aef-d755-4d35-b1f5-c5d07aefdbd3','8005d90d-acd1-42f4-b7e5-f2c25324d3d0','1.0',NULL,NULL,NULL,'timesten','timesten','timesten',NULL,NULL,NULL,NULL,NULL,NULL), +('6e5cb98b-a24e-4b1d-9504-ef472ba3b16c',NULL,'ddb9b833-5751-4672-8b25-bcc78eb0d447','9f1aca89-2f9a-4043-9118-fcff91c4593d','1.0',NULL,NULL,NULL,'ppd','ppd','ppd',NULL,NULL,NULL,NULL,NULL,NULL), +('6f39ab69-27f8-4def-b53d-906d272130b3',NULL,'5d5282b2-1126-4a8a-aa21-f5b949d07ca0','89eacbb2-ccaf-4120-b1d3-0291917bbf71','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('6f644aed-ee1d-4a4d-b2ed-a9c09a30aa7b',NULL,'e22db314-cbc4-4855-9e9c-9fb503a376bb','de35db61-91fd-46b7-b123-02f528e055fc','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('6fc2dc9a-1667-4035-b472-9fcbb22e42b2',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7040e1ad-9d82-42ac-a024-9ec2a454d8a7',NULL,'176d464b-2c2a-4cd0-9c2c-9421c6636631','02302049-3007-4fda-9e34-1302757b65a0','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('7047a19f-6e58-420e-b83a-fc5c5ca371a6',NULL,'5de3f65a-9a57-463b-8f57-42307d9b27f8','900b6e33-ce13-46e8-b9e9-56d21e4a4668','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('70575d9f-6067-447f-81f5-ea0f08ffdb1e',NULL,'b53cb5a0-ed82-440d-b202-d827469c1b5b','15082ced-72ff-4a76-9b75-20f103e50ca5','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7098128e-a6d9-4225-90ab-beac14b82ac5',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('70e9a7f0-ce7f-446d-9606-2396e83503f2',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('71c83b70-fd19-4961-910d-0715abe8cd7c',NULL,'5a315346-8d3e-4a2a-b4ff-a466fe54366e','d1c62b46-7a23-49aa-81c1-574694a4f33e','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('722602f7-f147-41fe-b72b-511af9552933',NULL,'d5697262-b1cf-4b31-ac95-94fb30481b33','978dd3f1-84f1-458f-963a-52be9d81a3a8','1.0',NULL,NULL,NULL,'prx','prx','prx',NULL,NULL,NULL,NULL,NULL,NULL), +('722b2624-586a-421f-9f11-97e442dd5806',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('725798c9-f501-4a90-9bc9-baba93016b34',NULL,'ec1d2810-17b8-43a6-bf78-dacc26dd89a0','c726cf5a-f50b-42d8-89a6-3c55a21c1109','1.0',NULL,NULL,NULL,'par','par','par',NULL,NULL,NULL,NULL,NULL,NULL), +('726dd182-74f2-47a0-bfcd-fb1cea8d089f',NULL,'faf71359-153f-4159-bc4e-290a85807d00','ade4b591-aabd-415a-84bb-e986d6ae635d','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('72c1a9fc-804d-4316-b6b3-bcec6e1cdcdd',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('730589ed-f654-4727-805f-d845fae5ac9a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('73909ae0-5388-4994-9eb1-47b334f23d4a',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('73ea2af6-ada6-44a5-b9dd-921a65c3e3e0',NULL,'7083fedb-430a-41bf-bb94-0eaf8b33fb30','39ff5503-11dd-4c6d-bf5d-1e1621cbf563','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('740d504a-2e21-430a-8354-11304c0cb493',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('74c7e2a4-6625-4fc8-8a60-02c0e72e0955',NULL,'1636f12d-c286-43d3-9473-b9723d5795e8','0531806f-4fed-4888-8f9e-bee67ab71ed0','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('74e26dce-9df9-41bd-a224-37ee65fb2884',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('74efb08c-7d76-4955-abe2-131f26c7c35b',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('75019b6a-8890-4a7d-87ec-35b64d18a34c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('75192ff4-b321-4ac2-a3d6-d734fc8a7d56',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('752db263-360a-481f-8613-5205e3755d17',NULL,'9793e8ae-82fb-4225-8cc8-ad0fa8d0532d','03996460-8c0d-42f0-abd9-96f2fb388fb2','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('754b4842-29a4-4559-9695-21269097b1ae',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('75855b5d-2b59-4763-905d-da64b66f4867',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('75999c1c-01ee-471c-905a-e4b895b01026',NULL,'4c65d534-a3d8-4e43-97b8-9220a27ef727','54e5eda7-baba-485d-9979-1cff464f4881','1.0',NULL,'Y',NULL,'vmxvre','vmxvre','vmxvre',NULL,'ns.c1r16d32.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('76040bc3-a498-468f-978f-6d4e7b9281ee',NULL,'29a93f90-907b-48ec-a34c-b9aa916f748a','fa90882f-9b77-49fd-8f59-46d15df379a2','1.0',NULL,NULL,NULL,'rdn','rdn','rdn',NULL,NULL,NULL,NULL,NULL,NULL), +('767a2fb6-d382-4aac-bfac-b47c69cf8409',NULL,'01071060-a604-4bd6-a228-2b3aebab1eb2','9b00b55f-c016-438f-9195-00a2d000a0df','1.0',NULL,NULL,NULL,'scheduledservices','scheduledservices','scheduledservices',NULL,NULL,NULL,NULL,NULL,NULL), +('76b1cb79-11b3-4ade-867a-287368c711b0',NULL,'c8935a10-d331-4cc3-8a16-3193dd459224','189760d4-5b9e-4287-b306-d27fc9cd083f','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('7764f563-3f27-42ac-8cdb-481f64969cbe',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7775a765-9048-446f-b876-e0bdf8c4989c',NULL,'81d23e7f-8cc6-49f1-b736-96eccad8103a','3b4e6f89-966e-4cb0-85ef-e8eee34b37dc','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('77812b13-4db0-4d86-abf6-a53f04bcdcfc',NULL,'1c59c549-70fe-4a9d-ab0d-b65f29d6065c','dccf95fa-281b-43f9-a0ed-cc4bef6df649','1.0',NULL,'Y',NULL,'sbc_b','sbc_b','sbc_b',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('7876ab13-7ce1-4f13-b63a-366e7499c74e',NULL,'76f85d22-025c-4d9e-89b1-0711f5cb09c5','abf7707d-0ed7-492f-8edf-436cd01f10cd','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('79aa3ba0-0a65-4580-a6f7-e6670578458d',NULL,'4df3b2bc-23aa-4f2e-8a66-19b86f4d248b','057c1236-b166-4ac8-8067-c18901bf4e0c','1.0',NULL,NULL,NULL,'plt','plt','plt',NULL,NULL,NULL,NULL,NULL,NULL), +('79b7c82d-4cf7-489b-a75c-0d55d1f2cc7b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('79ce1cd6-854f-4c93-b3b0-1d0372d4a03c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7a105b19-b89f-42e5-be0c-cf27b891f97f',NULL,'a8c5d8d9-7115-44f5-a3a2-6482bbbc8906','2a228b84-405d-4c59-bb1c-351893a473b6','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('7b276e5c-e8fe-4057-9422-91eb3def50b3',NULL,'10421357-a2b3-4a7a-b82d-125b2805fa5a','56324cee-8dfd-48f3-aae8-3101be93cdac','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('7d1c65c2-059e-4883-b28f-799f5dae4329',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7d90d5f1-df81-4a1f-b6d0-ec1237ec0ecc',NULL,'559e09d4-8cd8-477e-ade1-56d12cc7ec89','16e20c1a-fc9a-48b8-afa5-bfa59dbacc05','1.0',NULL,NULL,NULL,'vvig','vvig','vvig',NULL,NULL,NULL,NULL,NULL,NULL), +('7dd7e5c9-4337-4ce0-8fb2-ff26f0a3ca52',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7e59838f-0274-458f-a34f-9b91d79c3e1c',NULL,'671e38f2-c1f1-4112-bcb2-e2300efc794d','c1075235-d9c2-4a8b-8215-7e3ccb168ac5','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('7e943e8a-c651-47be-9e27-630b9efa5940',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('7eff938c-6dd7-4bb5-a39c-b7935329ee2d',NULL,'0cb480f6-dfbd-4af2-84b0-52b212694070','ec33342f-14ce-45b6-96d2-ac4403ade6f9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('80322740-def3-4b97-bc68-74735d1ac282',NULL,'6eb9f47d-23c5-4f36-a5be-49be4c168623','6be1b41b-c7b5-4d18-bdbb-ab1784f2392c','1.0',NULL,'Y',NULL,'vmxvpfe','vmxvpfe','vmxvpfe',NULL,'ns.c20r16d25.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('80a6176c-fcb5-42ca-a738-3fa40ea2660a',NULL,'1bcebed2-1f21-4264-b163-931211b1bf26','883a1cb8-43ca-4a52-b6b3-225255514bcb','1.0',NULL,NULL,NULL,'cognoscgw','cognoscgw','cognoscgw',NULL,NULL,NULL,NULL,NULL,NULL), +('80ca15af-4b70-4ee7-be37-0b1de73051a1',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('811e1edf-aa75-4d07-b98d-f47ccfa3ae35',NULL,'078b52a2-53d1-4d1b-8465-05beb27dd991','cd8a79b8-4384-4018-b8f2-0be19981c206','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('8127a732-3cba-4644-b86f-98327b512373',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('81d694d8-7253-400b-8310-a2d6489a523e',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('81f47a35-0ed3-4df8-ae79-70dffcda63c3',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8297192b-fb85-4459-aa83-15f19d3140b1',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('829fee2b-5317-4793-8c4f-2ac8de1b73c3',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('83c21766-f7b0-4c8c-a3e7-143c5469019e',NULL,'10421357-a2b3-4a7a-b82d-125b2805fa5a','56324cee-8dfd-48f3-aae8-3101be93cdac','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('83ce6e22-8cec-477c-b750-a37a14ae5450',NULL,'ca5310cc-a0df-4f90-9775-d0a8741a1587','a417848b-ff41-4399-9d70-cc64a27fa576','1.0',NULL,'Y',NULL,'mon','mon','mon',NULL,'{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('8439b3d0-35bc-48ab-8e13-6c08022a5a9d',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('859d4704-b610-4a2b-b112-000e403e823b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('85fdd64a-9f2d-4f27-a4ab-78f1a3a15200',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('86238ad4-5842-4d03-af1c-2f2ac40a6123',NULL,'72308d7a-5d2b-43d0-ab9d-1839fae15b63','f2c093f3-2f6d-46dd-880d-2831569cdaa9','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('8767130c-3c4a-41df-b78d-16d674949746',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('87715b73-66ea-4e22-8b92-d6130a757d96',NULL,'ef8e9f97-1c75-47a0-a3f3-f2e932a44b40','5b9af18a-e42d-436f-b61e-08d55d6f3050','1.0',NULL,NULL,NULL,'apigw','apigw','apigw',NULL,NULL,NULL,NULL,NULL,NULL), +('877a120e-1d41-4f74-865c-8a9d32b7f00c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('87c8ce73-2771-4ac1-b592-1d0fdb0806f6',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('890593d3-885d-4919-89da-838fa12b4790',NULL,'7afbfe3b-a909-4682-80d3-f5a1a57713ac','83458031-84c2-4d06-b977-53fe9b5d8100','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('891c94d3-bcff-4d5f-8a92-f1ef951fd9c4',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('895bba6a-2e3d-48f9-9e93-7a3de18b703f',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8ab47c0f-a4c5-43c3-9ebb-6dba37f4c576',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8ac0cb3a-dfb9-478b-96ab-c5ff0abb9609',NULL,'00648ac2-2381-4235-843e-882d30c6f7b2','7982cd91-807d-48cd-a3f2-0c40777b3df4','1.0',NULL,'Y',NULL,'oam','oam','oam','NIMBUS_PCRF_11.0.0Base-ATTM1.0.0.qcow2','nv.c12r48d100',NULL,'{ecomp_generated_naming=true}',0,NULL), +('8b3798b4-65d1-4032-a2b9-83b3708945bf',NULL,'6685b9d7-ae66-490a-8967-520549f7d6e5','f4c18fb7-ea8b-4e89-82e7-26525c528079','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('8ca7da2f-1cd5-4493-ab82-805f48d8bd71',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8da61575-f78e-4170-9b19-ebb14fb6c211',NULL,'686e6906-6dad-42e4-836d-b01dfd8dcd3b','050dd517-57da-45ad-86c8-d6c2d9cf742b','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('8e4a567c-3a73-49c2-95a9-2b092032ab10',NULL,'801f48a5-eb2c-49a2-a03c-4a3175bacbc3','4fddcad8-91f9-48cb-902b-b05fcd1fb98b','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('8e5d1a2d-9cf9-4988-961a-2e95772656d0',NULL,'b95401c8-5c5e-48b7-9839-d581cfca5935','4c671c7b-3ce5-48d6-b7ca-4047c3ebb2ef','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8e666420-f2c8-47ab-b593-ab4bd748460c',NULL,'fd0b5273-f01b-4129-8a20-447567d7c370','94bcc5fb-18c9-47f3-9bc1-db73fba3c210','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8e7289ce-c299-4ab5-8be7-245ef7b410db',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8e80f851-fe0b-4363-81b8-f7bd0e59016b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8e8a56fd-db66-462b-9e06-81e507a74a36',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('8ec1d032-e5eb-462a-b96c-40bed1028f51',NULL,'efcc4117-0c1d-43fa-b80b-1f34712021bd','cc772cf5-fc52-4cbb-8b6b-a58da7e40abd','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('9066cc10-a5a1-4f0d-9498-7ea314e836ba',NULL,'767cf039-9261-4efb-b63b-1f48a3391e74','ed19a0e7-2486-4c67-bbbb-01514efb4dac','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('9112fca1-6b0f-4f7a-9d1c-ed930ca86ffe',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('91c98964-347d-48e9-851d-57e22c4dddea',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('91e52c46-6dc8-4535-b1db-f1477ecfcaee',NULL,'f61424d4-acc4-42ae-8a41-03a0bc098132','c2039665-e5f5-4114-a94d-74804cac2ea0','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('922a84a0-d9ce-4ff7-b6bb-7d1ebcaa0c1c',NULL,'c7efdf88-8a09-41d3-908e-d1e513b3c745','a2d5099b-4254-4f7e-8d3d-ceb280571ee1','1.0',NULL,'Y',NULL,'plt','plt','plt','USP_IECF-PILOT_30.3.3-mcas4.4.6.qcow2','nd.c2r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('92f5bbb1-3215-4a80-95fe-aba44d79fb69',NULL,'1efb8470-f0d6-4e69-97eb-7dbec527dc6d','eed80211-44a5-4f21-bb1e-83b82635bb3b','1.0',NULL,NULL,NULL,'pcm','pcm','pcm',NULL,NULL,NULL,NULL,NULL,NULL), +('934d8e29-ab23-489e-910f-3e16db969d81',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('94738c09-9e9a-47e4-a444-c262328e1741',NULL,'00629390-ad5c-4a52-a04e-1efa3b2c9dc2','ea761b8a-e27f-470b-ba8a-a89e9b61b467','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('9519bd6e-527c-4f7a-a013-dd478fad64bd',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('953f220f-a3f1-4191-a7eb-722f841f2c0c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('95b5cde3-d489-4329-9b75-2aa01db6e6a1',NULL,'720c36a7-9380-4c11-a8ce-acb2ad5c2d7f','07285e73-89c2-4330-b09d-65f568c976de','1.0',NULL,'Y',NULL,'vdbe','vdbe','vdbe','SRX_DBE_15.1X49-D50.qcow2','nd.c2r6d20',NULL,'{ecomp_generated_naming=true}',0,NULL), +('95bdd202-1f6a-4812-ae1f-c8df2ed8ce9c',NULL,'324ba26b-468f-467b-9b49-021f76720277','ebffbeff-3b15-4ce9-abe7-654f0bd8615f','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('964808cb-2199-44fc-9390-004b8fa8d538',NULL,'dd0137f5-c6fd-4990-a217-8e3c41838bd3','14c13c2e-dccd-48af-b46a-5526f6640a63','1.0',NULL,NULL,NULL,'its','its','its',NULL,NULL,NULL,NULL,NULL,NULL), +('967653fc-d781-4f65-b513-7a111d854ffa',NULL,'f0d528fa-8ae2-4548-9e59-71bdf5b16b2b','d18b5d59-c65e-420d-ae28-8181e87520b6','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('970657f6-a90a-4758-ba4f-512da3aa07e4',NULL,'47e50720-58ad-41d5-a89d-a290833d5170','3ec89b15-8ef3-466b-8b6f-f8e658793601','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('97dafb56-c3df-4922-970d-b514118b1196',NULL,'f0d528fa-8ae2-4548-9e59-71bdf5b16b2b','d18b5d59-c65e-420d-ae28-8181e87520b6','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9842c47b-f484-4de6-864f-ca4fdaea3cad',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('99699375-0397-405b-89c7-32fc9f714e0a',NULL,'27f6423d-ab25-484a-86c7-038925e4cf30','10078587-93b2-4ec3-be27-c9172716e3bf','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('99781b3e-7c91-432c-af97-dccdf0e31281',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('99a274bf-c3fd-4d63-a4b1-1c7b4d9312d6',NULL,'05c097e1-9d0b-484d-9d3f-b4c4ecf6938b','f61c31cb-5ffc-47a4-b423-4aabc4afb2d7','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('99bd7230-87c4-4dc5-aba2-4a63ad55954c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('99cab556-8786-4fdc-8ff6-284aa7d47fa8',NULL,'cb26bc79-f5c2-4d70-96e5-8ef2ec5cb2f8','2354ae73-a126-4797-8136-56d5320c4efd','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('99f10ccf-e4d0-4c1a-87fc-9d4403f9bb57',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9b5fd226-047a-4702-ac8b-d84a4e12bcb1',NULL,'544f081b-41eb-41ed-aea3-82a53f8406b7','fd49fdc5-aa89-4528-88ad-7ab74497826e','1.0',NULL,NULL,NULL,'TEST_server','TEST_server','TEST_server',NULL,NULL,NULL,NULL,NULL,NULL), +('9b68a223-ae32-495b-9dbf-706d17f4edca',NULL,'fd0b5273-f01b-4129-8a20-447567d7c370','94bcc5fb-18c9-47f3-9bc1-db73fba3c210','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9bc3396f-861c-4bb7-b11c-e40ed9fc785b',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9cb550ff-94a8-46df-b216-8d8d79a4430c',NULL,'3021e249-ce61-4921-97d3-c620fee735d8','f5d1a9de-02c5-408f-9a58-f3f7dc40e91d','1.0',NULL,NULL,NULL,'converter','converter','converter',NULL,NULL,NULL,NULL,NULL,NULL), +('9d25a319-184f-41d8-b361-b3c34780815b',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9da1a65e-107f-4c2f-b3aa-5741f9ec4246',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9e0bae98-f88e-4afa-987e-44d6bf49d222',NULL,'4dbb5f94-045d-4daa-8cc0-6b67b14733e8','e41c812e-482a-4831-8a61-90ca514afc64','1.0',NULL,NULL,NULL,'mmsc','mmsc','mmsc',NULL,NULL,NULL,NULL,NULL,NULL), +('9e9a03db-5e18-4080-9a99-3befee79d106',NULL,'8cf09ba8-a266-426d-b10e-77f8bfb0fa2f','e628f731-8879-41c3-b391-482b2d255f7d','1.0',NULL,'Y',NULL,'rtp_msc_a','rtp_msc_a','rtp_msc_a',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('9ead1a85-5592-4784-879c-147a94bea966',NULL,'b2d3805f-a918-4f95-b4fa-f6c5b8dab1ca','2e090e82-864f-4d48-9c74-dd8a812c2396','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('9eb9415d-9c3a-499e-9889-d97647df8b41',NULL,'fdb7b451-b225-464e-92da-fe01b24215e6','12b488c0-ff81-4840-930d-94020426b7da','1.0',NULL,'Y',NULL,'adm','adm','adm',NULL,'{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('9eba7181-1630-49c1-8698-a94dd8ca95b2',NULL,'2e0cd406-2bdb-48dc-b262-c7e45f1216b5','4f3990bc-bedc-4308-a3ac-6900eb684e9b','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('9f0d1717-e20d-4c2e-9c64-f7ce4b9b13d4',NULL,'c30e7d17-563f-41fc-99dc-6390c831ee08','367294b2-ef14-49bc-8b01-d7cfdccaf0c1','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('9f240ab4-117b-4bd4-aeac-432607eaeb6d',NULL,'5c92f734-aee4-4431-bffd-4b1613b40eed','d39c7ac8-25d3-47b0-a10a-7474dad90e21','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9f4130d6-6e88-4759-a635-ff24c6c7814c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9f46cf9c-6b2c-41b8-a4b6-27b5e6373538',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('9fad30e6-3822-48a6-ad15-caa62566abe6',NULL,'3ab414a7-b8b9-49ca-96c5-8e0bec348412','52e44eae-1f79-43ec-ac74-cf6501fb6e26','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('a00628bd-e870-4679-80ed-0423caad18df',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a0083208-228e-42d8-82db-ff463b8704b8',NULL,'1dff89b9-f323-482b-b7a7-e049f9ad7635','0ce097c2-4121-449f-9f98-63532a8bff55','1.0',NULL,NULL,NULL,'vertica','vertica','vertica',NULL,NULL,NULL,NULL,NULL,NULL), +('a0154f8d-ac4d-4af1-abd0-e660f7562d35',NULL,'4ca1e003-d833-4bdc-877a-e4d7aeb6a4b7','2b6676c6-90b2-4d39-be19-b1ffbd23f558','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a0ec6cac-6fc9-4429-8387-93593d2072df',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a116fc55-74a0-4d69-b034-34170799ac3c',NULL,'cb8841a3-5eb5-4c72-844b-16dcb0d3b7e4','c4342af1-f173-4d83-bbcb-0c9fdd7b9567','1.0',NULL,NULL,NULL,'d2ice','d2ice','d2ice',NULL,NULL,NULL,NULL,NULL,NULL), +('a1b72bd2-0d25-4031-973a-c9600dab5f78',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a1cd762a-7c3c-4839-a2eb-e77bb374eca3',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a1e0d30a-598b-43cf-b1ef-62158ffc70eb',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a26fdde2-478b-4b1b-ba35-af8b6f3da856',NULL,'10421357-a2b3-4a7a-b82d-125b2805fa5a','56324cee-8dfd-48f3-aae8-3101be93cdac','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('a27d8879-67a2-4537-b326-2c072e31f68c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a27f0fb5-4744-4b99-af5b-1dd1d59c8725',NULL,'c6f03037-253c-473b-a538-73246b291185','cb19a064-c90f-4d71-b01b-a0bca8ed5e4b','1.0',NULL,NULL,NULL,'itm','itm','itm',NULL,NULL,NULL,NULL,NULL,NULL), +('a2a8f05f-7d29-417a-af2a-00c3ec229246',NULL,'ce2aa7f5-6fa8-46c1-9790-8ae7b49a6306','e395e992-e359-4635-a463-ab9b9fb027bc','1.0',NULL,'Y',NULL,'mda','mda','mda','{}','{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('a3dd0b00-859a-4567-afd5-08efb92072e7',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a52999b1-dab9-42cf-9853-1d831eb0d318',NULL,'b173ab2a-9b2b-433d-883e-3c153f39c331','464f4ed6-75d9-4a48-bb9c-9a49b4da172f','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL), +('a54fdfd0-33da-462b-883f-f7ddc2d86e1c',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a5653b1c-6e73-4ee6-a5e0-5f1bcb1ea959',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a5ece57f-58c7-4e9f-80f4-6a2d0a4bec38',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a5f25e31-5059-4d50-97ef-26735df799ed',NULL,'9e4e3726-d8a8-4a40-8fae-f4bb46135d3f','08253508-dd15-4202-bfaa-c105f0a8c19f','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('a60c2994-8089-42ff-90ce-656c6aeeac42',NULL,'7513c82e-63de-47f8-94b6-83ea61446fc1','82104fb7-3f0f-4c6b-97a2-adce8c48a7b2','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a682c9ab-b50c-429f-a605-2469a4efb829',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a698af7d-6797-4807-907f-f9e60593d082',NULL,'90177c20-11a9-4a85-bac6-067f4c88403b','cbae819f-fe79-4031-8a06-79026c8eb1fe','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('a6d1fe14-e363-4c05-9c68-a23e3ff4e816',NULL,'55372be2-6074-4793-92b1-e0fe1afb08b7','d03e16a8-becc-435b-aacd-829f6e3150b3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a727ca3c-cccb-45fd-a3dc-1b030b1fca71',NULL,'c12a93bb-bb70-4f40-8823-155980ad078f','cef11b73-aa73-4f88-8b6c-34d21d55b8cf','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('a72f75fc-126f-4a3b-a125-a33e89fb3ca6',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a7fad07d-f91c-44fd-98f9-4952f35f3875',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a808430e-4931-417a-b6d8-183a719d1803',NULL,'83429bf9-49f1-4187-a5ad-afc329a84e76','ce422e74-7e58-4464-8a54-61e21f3ca7e5','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a8bb4868-11f8-4eaf-a411-007f6691ef99',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('a91bc7ee-82ae-46b4-9eb4-4a92fef3f00c',NULL,'9e68d141-f3ab-4436-a1a6-52f83a2908ba','7d33eb47-6050-4ef6-aea5-0485360ff4e8','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('aa008846-3e9f-462e-867d-653358cd6d8d',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('aa8a4494-cd9e-444f-a174-9f2590bbc692',NULL,'178dcae6-892b-4fd8-9da9-bdf30da013ae','50d30dc2-fe59-46be-92e1-2844868bf1ab','1.0',NULL,'Y',NULL,'vmxvre','vmxvre','vmxvre',NULL,'ns.c1r16d32.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('aaad4b91-f2bd-4157-b386-fb7955b1dfc9',NULL,'9b3265aa-64a8-498a-aa68-2d6a65c34ac2','d3351d9a-5b8c-423f-b63d-bdba0716b04f','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('ab26b6c2-af90-4f66-bc2b-f500a3ca1a5c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ac0cd98d-35ee-438c-a45e-9a2447c603a4',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ac377ae1-fd6b-41e4-9aff-a6b2b038d484',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ac496aaf-ecff-4db3-acb7-cd9989db2b21',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('aca91a09-aa6f-4701-bce6-2ded800ac69a',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ad6791e1-eefe-49b4-bce3-3e5b76555fb9',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('adcc1687-2e29-4b48-81cf-d671aaff5cef',NULL,'d2c6e47e-7320-4559-876c-65f21e71be94','71db90f8-ae2e-44a2-b57d-e96de3f89b66','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('ae6938ed-7d85-4d1c-b08b-683eaeeb8861',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('af36dd7e-6e79-4b5b-b031-d1a7ff2876b1',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('afc8dd7b-f829-4d44-a52f-ee0665d770b7',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b04d88cc-cf85-4968-82c8-c950f4487d0c',NULL,'143fc587-69af-4c05-b624-d5d0cf0d2b44','4b5305d2-022c-47ab-8f47-7f795a6a64a0','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('b09c467f-048d-42e9-a127-79c8bf3b090d',NULL,'5818d233-caf4-4825-a7bb-144bbd731329','b8c28cad-e97a-4ee8-bc64-119b373cf98f','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b0f2b86e-1b9a-4d3b-9dd8-ace1ee07976f',NULL,'3ca34c00-47ad-407b-8b31-d209843f7a07','a6a47256-5dad-44bb-afd3-a3dcb58b6493','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b14c2a09-89e7-487f-95ec-1b5bbc3399e4',NULL,'ea6ed17e-b52c-4a66-8bb3-8e5f6f3fef39','c14a722e-7f86-4577-9583-ba9397a2a54d','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('b1ff5519-4c6c-4378-99ab-df79b2802406',NULL,'64607264-f245-419c-b490-5b40cdc6c8d1','23aee13f-2ba4-4f62-8739-60655b38e537','1.0',NULL,'Y',NULL,'ssc_a','ssc_a','ssc_a',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('b2f1e772-dc8d-4048-b984-441ad81f3955',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b328a3fe-e2c5-4fc0-800f-f3a64ca779d4',NULL,'231e7f44-fdbc-40a0-b836-c3302421004d','e66f3e27-27f7-450c-b3b7-cdaf43d262b6','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b36490f4-abe6-4951-8f46-72889c614c4a',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b3a64b54-ea13-43c7-af8f-3b69a538c213',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b4100792-9341-4078-bac7-404b684f211c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b4483cf2-b435-4ed2-b45c-93a2f2bcda66',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b6444afc-7bf1-4170-83f7-8c932d5a55c9',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b6d5b572-0a9d-4de7-ba44-bd02bdf95626',NULL,'5e6be389-4ca1-4344-b497-d40e7d76de5b','280afa6d-83d3-4ecf-9cdf-47a2e4b0431e','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('b6e7344e-5dc6-4b71-9735-fc047e5b999a',NULL,'49c1424b-5e2d-4e16-b1f3-1f20fd529925','651bfb5d-d5cd-4ef0-bb26-0eb3bbbe71b8','1.0',NULL,NULL,NULL,'psm','psm','psm',NULL,NULL,NULL,NULL,NULL,NULL), +('b6ff6a80-ee73-415d-b4d8-9e97cd788e1d',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b773d671-6888-48ca-8ba8-609371bfccb6',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b7cf537e-9b62-40e8-9f1d-278ff0b7986e',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b858d606-617d-4b29-b749-e51e70c52e5c',NULL,'80501dcd-d0a6-4101-92b2-6a2249258d4f','e2eb1e3f-ca9a-406c-bcfe-d53b87e0fa27','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('b87c7274-78d0-4549-ba63-9fdbdefe239d',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b8935925-e0bb-4103-b64b-14e24237599b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b8cddb4a-babb-49e0-a369-4ba04908d4f7',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b8e49d1b-e5ee-4e25-8d20-61e5588f5f87',NULL,'a17323d7-1f15-459a-93a1-2523b2dcc909','78a657d7-74d1-44bf-939c-73d748dc4ebc','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('b95b06d3-f566-4d75-a43b-fbf94d9f9645',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('b9b64e3f-7b45-4293-b742-21b5bd63fac2',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ba3c401d-def7-4085-bd8b-5cfad9cb94a9',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bb0cd22b-bb81-4fbe-b756-94cd3b94255b',NULL,'51a669a5-4c83-4231-8aa0-9939acf835ef','3b97c83c-ee8b-4eb7-9910-428b7a58d9cb','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bb6da603-e8ec-435e-b84f-27e3985a1f91',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bbadc8e6-b898-46ef-8204-06e125a690d6',NULL,'44c2244b-b8c1-4788-886b-28addae150ec','76408aa4-80ce-4974-aed7-77336f6fecb0','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('bcbc6708-3697-430c-a8e8-6250939ecf5c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bcdd7c03-4140-4378-b00a-3775089ae232',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bd18c89f-92d2-4cc9-ae09-dac57219db9a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bd800b26-228f-40db-bd98-dd4afade8ee4',NULL,'a768414c-507d-4120-a1a4-ed2c1ec3f4ad','8d8fcea8-4352-48a2-8e39-10b3b8862743','1.0',NULL,NULL,NULL,'cm','cm','cm',NULL,NULL,NULL,NULL,NULL,NULL), +('be1a6293-fa3b-4a2f-afd6-480f2e70a5d2',NULL,'bfc9b3ec-9c4f-4caa-9489-4c3e6c99a4ce','9fe7109f-e328-4ae1-aa27-1ea33b72613a','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('be65d2ae-31cc-479c-9156-e7f1d6b6a4b4',NULL,'f30f9166-702e-47b8-8f0a-d5523f86b7d6','73aaf1fa-265c-4f13-a171-ca8dc4c908ff','1.0',NULL,NULL,NULL,'qtrace','qtrace','qtrace',NULL,NULL,NULL,NULL,NULL,NULL), +('be96e427-e84c-4a57-b169-5490bc2bde4c',NULL,'fc60c10b-f1ba-4e3d-9c41-e4eff820162e','c05c500e-e9c8-4edf-9e94-6af1779e62c0','1.0',NULL,NULL,NULL,'mmsc','mmsc','mmsc',NULL,NULL,NULL,NULL,NULL,NULL), +('bf11ea87-eca7-4bfe-a958-a6395c14c11a',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('bf4cfefa-3bf4-43a9-a7b4-d091f92586e3',NULL,'484fc852-b184-4321-ac3a-0a95d254fa6c','31be2acb-c53a-4a8c-a3ed-ff6d2db67255','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('c0228379-2c35-4d53-bffd-b22f70e5b131',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c0269cef-1de3-4b79-8c45-790e56540ac9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c05551e2-d5f7-4fba-bd08-c76085bc0bd7',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c0a21a31-56f6-4ed0-9647-f2c9cfb22737',NULL,'482d5ad8-7f48-444d-8b45-2817b8309075','2c1d7d2a-0122-4a1c-8be6-ce19cd9c3592','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('c0e635b4-e210-4c0a-ade3-943aab8ee3e3',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c1cba325-dce0-418b-9ec1-61bf6ecac873',NULL,'e2d673cd-88da-46ea-a591-5f2b7c835639','279ac5e4-a5d9-48ab-82ab-9d336c0f96d3','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('c23ac2f2-56ff-4ecc-b65d-65dd8f82a0cc',NULL,'629adabe-cc44-4989-8f2a-75b55f7737e4','e82cdbcc-5bbf-4dcb-9a0f-17c6e4766801','1.0',NULL,NULL,NULL,'daemon','daemon','daemon',NULL,NULL,NULL,NULL,NULL,NULL), +('c2655316-7724-4fe0-9ace-cad170838ed0',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c2bc34f3-ec20-4f40-a6ff-c0913ac9b180',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c3afd8d5-cc77-43e9-baaf-7caf60146b15',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c3ec6c74-294e-4eec-825e-3071b55a08c0',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c43aef22-8dd1-4e8c-8169-f88da3ef2160',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c4753b00-af1d-4b49-bcfa-475effeaa3ca',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c4c23e62-b07d-4856-ad5b-af6a3980fae2',NULL,'e1158f69-c65d-4b6b-8332-46ef339ffc81','9a2de0f9-0535-4bf1-8e5c-47cfd7affe43','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('c4d1cc21-49d5-4f45-a6ac-539165918edb',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c504575d-ec87-4c75-b3cf-26b561c77c8c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c5d7d223-39d1-401c-98eb-0680733d2872',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c5eb0c33-6a51-400b-8186-d7fc1f0bee13',NULL,'e996f365-b29f-471b-8b32-baf93152eb81','c3f2985e-1999-419a-bcf7-91560cca1a1f','1.0',NULL,NULL,NULL,'smp','smp','smp',NULL,NULL,NULL,NULL,NULL,NULL), +('c6e0a9c3-babd-4517-988c-5f0c90877b1c',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c788c709-f8a6-453e-ad1e-8dfa63492dbb',NULL,'8a895561-a663-4b64-b421-7416bf9d4a8b','795d516f-34ca-4a0e-a74b-c4746eae4300','1.0',NULL,NULL,NULL,'code1','tag1','tag1',NULL,NULL,NULL,NULL,NULL,NULL), +('c7b54e8e-8121-4102-b5d0-b25181920fec',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c7d68a7a-7496-46de-adef-dd7b82f2e742',NULL,'00f8e942-ae52-4da5-b459-8fb54eee2adc','b1b37903-9386-4912-8a60-ed692a03b52c','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('c859e495-1df4-4613-8193-357defa1ec51',NULL,'088d65a7-f6fb-4214-b5fb-f5fa6948a7d1','92f3786d-9aa7-413b-b751-e7a8595c7c22','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('c873746f-0a6e-422b-9efd-44aae71283a7',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c877c31e-896a-4f07-9c25-e5a447462ff5',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c8ab7283-5834-4c61-a165-c1e292711a59',NULL,'1572dff4-d406-40ad-afd4-9828e66347a1','3da37bf6-87b4-4b98-a9a5-d2c18a7ab8ab','1.0',NULL,'Y',NULL,'vmt','vmt','vmt',NULL,'{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('c935fb51-b144-4f95-804f-8c21e8ab3769',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c9527801-36a0-4fb3-a6ce-3c3e685283ab',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('c9f6627a-41c8-4805-8d30-74d755e3bd94',NULL,'899ccf77-9926-47c5-9e96-7f32c7535455','5d660f11-702c-4875-b446-efaa631488c9','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('cb0fa12b-221c-41d3-b900-786711f5deba',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('cc1fb9ba-e8d8-4544-b893-19784421da07',NULL,'e55ea388-7c7a-4624-98d0-530b1cf12353','a6df5997-cae3-47bc-b11f-a8ae9ea15755','1.0',NULL,NULL,NULL,'microservices','microservices','microservices',NULL,NULL,NULL,NULL,NULL,NULL), +('cc2f9ba3-0a21-47cc-8e5c-d40b0b36b786',NULL,'46359680-71dd-4c95-954d-70e1286003bc','b62b2cb6-cedb-4aa5-8501-d733dbad7546','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('cca81022-c403-46e3-a617-cf9d001532a1',NULL,'c6a26e4e-4ba9-4abb-80c0-99af10e3e045','a7cf9a89-0b67-4247-bbfb-8fd671d0c13a','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('cd5501b1-1490-4b85-b954-8c3dcc641bf5',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('cdd0c29a-5067-4549-ac36-f437c64b79ed',NULL,'e886bdeb-5486-4ecf-ad03-56837ab6e550','5e749085-6671-4472-a068-e9a974324c2a','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('cebe69d9-1c8e-45c0-9ab4-a0506c636d92',NULL,'1172e0ac-8e56-4fdf-8454-18e2964e97de','440ce9b8-e1ba-4b63-918c-b433afb97d11','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('cf3e09d9-0a4c-4e54-9925-df317d9ac3ef',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('cfa061e6-f6b5-4f2e-b605-f4cccf69a1ff',NULL,'e53b0aae-f8b0-4776-bb40-837c5d48e289','87425303-683f-414d-a84e-1ce7534688d5','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('d014e9dd-284b-4baf-acaf-6caae88eaec1',NULL,'5014d933-aa2f-4ea9-87f1-70729f080747','331d6f77-d90a-4c83-a11f-176ca9c901ab','1.0',NULL,NULL,NULL,'mmsc','mmsc','mmsc',NULL,NULL,NULL,NULL,NULL,NULL), +('d01bd75c-4c1c-415d-9a8b-a48d50589089',NULL,'0e2da292-c026-499e-978d-8a9912b8f3c3','50dd9a89-6184-40f1-8d61-3586369f647e','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('d05e773f-2d6c-4a8c-9ed9-e29eaaab7a10',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d0d264c5-eb08-416d-9e2f-d78649e3eb07',NULL,'51e3f3de-b2c9-4cdb-9ed1-7d689d1df408','9e4c8069-d199-43ea-8eb3-ca1b5bb433d5','1.0',NULL,NULL,NULL,'fe','fe','fe',NULL,NULL,NULL,NULL,NULL,NULL), +('d18761e1-1c7e-45b5-92d3-bf057164629b',NULL,'87cb315b-4c0a-4c65-81a6-8221562f6a8e','0312fa13-5678-4ff7-b5ab-d2eb370cd44c','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d1942b6f-5cfb-4167-a158-4a556d32d6fd',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d1c09e21-5074-4c80-9864-8bcdd3ef9d07',NULL,'4ca1e003-d833-4bdc-877a-e4d7aeb6a4b7','2b6676c6-90b2-4d39-be19-b1ffbd23f558','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d2283908-05ea-4f6e-9e6a-c891f2df406f',NULL,'039aeb04-d31a-48bd-9459-29539639d6ec','2bec9788-7039-4c59-aec1-35aae3903c19','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('d23cab29-da46-4aeb-b04d-3895f5ec3a76',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d2547357-4c45-4462-bc6b-46d640a4c1b8',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d25e12e3-8cf3-4fce-8fd2-bf21f0f0e795',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d2931a86-1b18-414c-a6f2-edd5cc1a26e9',NULL,'1b9d7f98-60f9-476a-bd30-dc200fa89f93','0318d0e9-d938-4c4a-9157-848e5564f717','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d2e1e04b-0622-4624-868a-ff6a71b5adf3',NULL,'c5993503-367f-4d34-901f-95fb562591fd','6ab10218-fb57-4423-b838-48efcec339a7','1.0',NULL,NULL,NULL,'conductor','conductor','conductor',NULL,NULL,NULL,NULL,NULL,NULL), +('d330374c-aa93-4dfc-b4f4-a3dc4411b9aa',NULL,'a3f9c583-bbfa-44a2-bc51-03f77a2bc8a7','8d63b561-50b8-44c9-a899-627687b6c930','1.0',NULL,'Y',NULL,'vmxvre','vmxvre','vmxvre',NULL,'ns.c1r16d32.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d38f40ad-a4bd-4736-b324-486373898759',NULL,'1e7d318b-f33b-4b90-9d75-6da7922361ed','35e68c56-72ff-43fc-892d-96164bd1f244','1.0',NULL,NULL,NULL,'pd_server','pd_server','pd_server',NULL,NULL,NULL,NULL,NULL,NULL), +('d3afb81a-50f1-4e04-86de-7498741fcb62',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d44562b3-5960-474d-bfd3-e38bb638948c',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d48099b0-2b0a-4c5c-a2bd-aaf4727bb13d',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d486859c-c045-4216-a4a1-32901540ed1f',NULL,'0ad0f610-74d9-4ddf-ad83-beca6203c3ce','87b6d27b-185e-419f-acfc-3f8bd659ce9c','2.0',NULL,NULL,NULL,'TEST_server','TEST_server','TEST_server','{}','{}',NULL,NULL,0,NULL), +('d4ceca44-046f-4a8c-bc8f-4e55b39be39a',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d4d60fbb-3af9-42f7-9da9-1fd955e5c086',NULL,'83e2f5f6-c7ab-4f9f-be3e-3566dce5ca4a','f2e899b2-50df-4cb3-aa4b-2ffccad39e61','1.0',NULL,'Y',NULL,'vmxvre','vmxvre','vmxvre',NULL,'ns.c1r16d32.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d4ee269d-563e-4b40-abc0-b9e831167253',NULL,'00df4ead-6147-413b-8658-064bf60b45f4','ce27c3d9-e589-462e-aa30-f7aa0693cbfc','1.0',NULL,'Y',NULL,'iox','iox','iox','USP_IECF-IO_30.3.3-mcas4.4.6.qcow2','nd.c4r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d5a9f7ee-97bc-4f4c-a505-bcd49151fa80',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d5cbf388-721f-4e72-aeed-8eb087b54fdb',NULL,'3c185a74-5a29-476d-a557-31af4c5e3ad6','34756e5d-c023-466f-a330-43c1e01a4491','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('d6aeb78d-9a31-494f-ab0e-936748eac20d',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d6f25bbc-9478-4885-b899-5cd6739557b3',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d7724722-c600-4a34-a813-3583d60a3776',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d77a5564-8dc8-492e-8d9b-2a93f6e6c8a3',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d7e69e58-c9b2-4480-8860-748656b693c1',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','7f26a2f8-3e6f-463d-8d7d-2a8fc36b2935','11.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d7ef089b-0fb6-4355-aef4-24bb33ad5d61',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d813efe8-c11f-415f-a7e7-4fbca9e92318',NULL,'4354b220-90ef-4473-9d12-ce784891b4a7','4cdca75a-3f10-4658-ad63-4d30c6fab96c','1.0',NULL,'Y',NULL,'pps','pps','pps','NIMBUS_PCRF_11.0.0Base-ATTM1.0.0.qcow2','nv.c8r12d100',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d89ef92d-7708-473c-9843-151525428a3c',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d9023921-639c-4f29-bc39-75574e715492',NULL,'40fa1c65-5db5-435c-8465-2ea98a49bfff','3bb7ef22-bd9f-4818-abb4-19c560e3661b','1.0',NULL,'Y',NULL,'vmxvpfe','vmxvpfe','vmxvpfe',NULL,'ns.c22r16d25.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('d955ecf3-c37b-4829-a592-ed0c5dfac3db',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('d9bb4581-b99a-4810-8bf7-2ddabf069573',NULL,'63b30309-8d17-4a53-8a8e-d5c84dc67971','39962b65-2689-4dca-85d6-af29ac04af02','1.0',NULL,NULL,NULL,'plt','plt','plt',NULL,NULL,NULL,NULL,NULL,NULL), +('da276e91-0540-41d0-b6b2-f062e9ffea98',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('dac39219-5bbb-466a-8136-f2b3cd715957',NULL,'4ee9e271-2073-4399-9779-0756f838f560','265e608e-9304-4996-91bc-2f2edb888a61','1.0',NULL,NULL,NULL,'ppd','ppd','ppd',NULL,NULL,NULL,NULL,NULL,NULL), +('daef9b68-c885-4fd9-905b-81d02287b400',NULL,'7c072a5c-87da-43d6-a240-1bb4f5c48c8d','b158181f-e1da-43f3-89cd-41e8db24852a','1.0',NULL,NULL,NULL,'analyst','analyst','analyst',NULL,NULL,NULL,NULL,NULL,NULL), +('db6a3c01-6635-427c-b022-4826a6abcf38',NULL,'fcec5e47-ce59-4541-bcd1-1115037bc77d','f76a36a2-9ffb-459d-8065-e022dbd04c17','1.0',NULL,NULL,NULL,'nems_fe','nems_fe','nems_fe',NULL,NULL,NULL,NULL,NULL,NULL), +('dc82a28b-e06c-4362-b9a9-1a8536d11103',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('dcdb832d-6202-4b2d-a5c8-75eef953ebfb',NULL,'4b2c0f45-4236-4219-b063-e2ca9c655af5','c8d403d0-3996-42e0-92b3-e26f3346f7f1','1.0',NULL,NULL,NULL,'psm','psm','psm',NULL,NULL,NULL,NULL,NULL,NULL), +('dd6bb792-56c1-401a-957c-1494e42d059c',NULL,'e2824f52-f71f-4dda-9e2d-9dd1c6163123','7495d002-4660-40e3-a834-b7bcaabeb7be','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('ddb68a75-d9ac-4179-b00b-e5202eedb221',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('de5dad75-6519-42c9-b6fc-a73958971f26',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('de666e4b-8026-48ca-a753-4c8b6314edcf',NULL,'f9cb9e26-f215-4d92-9686-c01d215c2370','e401c6be-3e29-4f6b-a9ff-dd289e15f3fd','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('df6167af-bf7a-46a0-a39c-b8e4834f2c70',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('e011021c-1e17-4357-9390-138924d67df8',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e03f15f3-ecb9-4b34-ac1b-d33bab8cee2f',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e077e430-fdf1-4dc3-ae2d-ed02cb0534be',NULL,'50696315-5bde-4a61-91c2-6fb9a47fb333','daf91cde-5b47-42c7-8b85-d18607ffe31f','1.0',NULL,NULL,NULL,'drbd','drbd','drbd',NULL,NULL,NULL,NULL,NULL,NULL), +('e0894eed-1665-47ea-9bab-01d3d33b8a6a',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e0c44b72-4d57-4368-8f37-baa4bc507d53',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e10c30eb-e67f-49bc-a3b9-53ac87f5147c',NULL,'d8e95546-60f7-4d74-9bc3-97326e57f9bf','d003593a-de80-4202-9a80-bc5338c679c4','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'nd.c4r8d0',NULL,NULL,NULL,NULL), +('e1696594-145c-44aa-b2ff-3a3679ee9daf',NULL,'607b0e02-9797-4251-b4af-7e25023653cd','8b3f7cec-61a7-4299-92c5-a0a0bda4aa7b','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('e1d9a966-9f3c-48c6-8445-25faf6279e04',NULL,'a2f315f2-5965-496c-aed6-7d3a3e3b9e93','b709e309-c645-4177-bb54-739b2d4c3fe3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e258f6b9-ab1a-4509-a5dd-14af510f39bf',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e2e2fee7-7f1b-4d05-bc71-0623bf4bca83',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e3119061-af71-4b1f-b2a7-6270561f89c4',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e319c3d2-4908-47c6-9d34-6167831748d5',NULL,'a9d90156-8109-4a7f-af9e-bab39b0eb5ed','2dd777d8-0fa9-4a16-9d57-367c066398e9','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('e3d8f89e-c5ec-46b1-9ed9-e09aee95397e',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e400273f-1161-43eb-8c06-e1b5eade4b5f',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e479c112-5d01-4a10-af33-74f0f476ba05',NULL,'72308d7a-5d2b-43d0-ab9d-1839fae15b63','f2c093f3-2f6d-46dd-880d-2831569cdaa9','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('e4bbdb28-c969-4f36-b071-9b2f93eccb78',NULL,'86f39736-fe98-410c-b0a1-12baf7a64626','369abd2c-c79a-4ee3-9152-a158a8e160a9','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e4da2213-136c-4883-8dda-672b92574558',NULL,'0d9310c0-238a-419c-9abf-a10c468f842b','60b3d723-a2af-427f-ae3a-c2626f860930','1.0',NULL,NULL,NULL,'par','par','par',NULL,NULL,NULL,NULL,NULL,NULL), +('e53ac4a4-2f1d-4979-abe9-6fdd18024252',NULL,'1ed55cb2-1569-4daa-8156-0c653a9a1bd2','97d74a37-0916-4de2-9f14-8a043228c4e8','1.0',NULL,NULL,NULL,'be','be','be',NULL,NULL,NULL,NULL,NULL,NULL), +('e63dfc74-a391-4dd1-b498-502deabad064',NULL,'5de3f65a-9a57-463b-8f57-42307d9b27f8','900b6e33-ce13-46e8-b9e9-56d21e4a4668','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e6898721-cbc0-4d92-b356-e0e3c6cdb571',NULL,'f9f13cd4-2c3c-4e4b-99eb-697877a83156','e0dad5f4-47b6-4973-8c3c-978ab29ac010','1.0',NULL,'Y',NULL,'app','app','app','USP_IECF-APP_30.3.3-mcas4.4.6.qcow2','nd.c12r4d50',NULL,'{ecomp_generated_naming=true}',0,NULL), +('e6d3fdb1-8bc3-4312-9489-1e76c8efb4af',NULL,'90a23913-8d7d-4272-b2d4-ebe81667cf17','9335c8ba-9677-4a88-b6cb-8078792b0974','1.0',NULL,NULL,NULL,'sm','sm','sm',NULL,NULL,NULL,NULL,NULL,NULL), +('e7456fde-73be-44b6-97be-3cd6bd0e200a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e755b80d-4779-439a-98e0-f322d2d70f5d',NULL,'1f972070-da5e-45d4-b134-7f1dcd1e1848','854c5b98-6905-4ca1-a71c-23d0220c949a','1.0',NULL,NULL,NULL,'distributedlock','distributedlock','distributedlock',NULL,NULL,NULL,NULL,NULL,NULL), +('e7678c43-dd5e-4a55-b58d-d58217d10292',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e77e6de3-e3a6-4579-b323-6ea911c5b3f0',NULL,'5cc8a5cb-fc45-4ce0-8e95-6d221bd76d46','a5c14db7-eab9-4e7e-8dba-aa9421819132','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('e821918b-15ea-4a78-8f7f-840bb3959ea1',NULL,'5adbe212-db9f-4a6c-9871-226111051aa2','e7b9821a-fec2-4a9e-9213-badec9e4bd60','7.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e86fca77-08a7-4fea-8785-c4dbdbb221ad',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e9154076-fd6e-4cb8-8f27-8d95111c6c59',NULL,'01cf04fe-b053-40b9-868e-0436453ee927','1f4f659f-5f6a-4e59-a8a8-c061579a5d01','1.0',NULL,NULL,NULL,'app','app','app',NULL,NULL,NULL,NULL,NULL,NULL), +('e918ccc5-223a-4d8f-a6d1-73d3de95a6b3',NULL,'3ca34c00-47ad-407b-8b31-d209843f7a07','a6a47256-5dad-44bb-afd3-a3dcb58b6493','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('e949e615-fadb-44a6-84df-f9f39864dbce',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ea133bc3-41e3-415d-a0b2-c65665d6e44e',NULL,'5d8c005f-4a39-408f-9371-fd6dbb816d52','a9ac2bcc-09d7-495a-9fcf-f24e505f06ef','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('ea3747eb-8a8e-4714-917c-63fd80ffe88c',NULL,'52e18045-96d2-4150-940d-dfb0b8de5ad5','f16f1489-d1a9-4dba-b02d-43cbe052fcc6','1.0',NULL,NULL,NULL,'oam','oam','oam',NULL,NULL,NULL,NULL,NULL,NULL),('eaa6a0ff-126e-491b-ae71-c66f305fb527',NULL,'f9737450-54bd-4567-b8aa-bc41eff0907c','3a96d13f-ad83-4d66-9f09-49d348a1aa24','1.0',NULL,NULL,NULL,'pd_server','pd_server','pd_server',NULL,NULL,NULL,NULL,NULL,NULL), +('eafb6ec4-8870-4d6c-a6e8-b0865268427a',NULL,'fbb05866-aa6a-4dd4-97f7-a20346d5f024','a1fa23a7-c5c6-493e-a1f0-981af15e337c','1.0',NULL,'Y',NULL,'psm','psm','psm','NIMBUS_PCRF_11.0.0Base-ATTM1.0.0.qcow2','nv.c6r96d100',NULL,'{ecomp_generated_naming=true}',0,NULL), +('eb386141-d1cd-418c-88d0-dd6769a73727',NULL,'b793b557-d2ab-4d37-bda1-b897925c5aec','0a04f17d-b28b-435c-96d7-7bbe6c7072e5','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('eb653250-d8ab-419d-9b4a-eb0d283e3f84',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('eb73da35-bf2f-4b15-a6fc-4a8c7a81ea2e',NULL,'aaa774f2-5100-4b89-9ffa-75ca47774f21','8081cb51-9c3d-4320-8f3b-9f5b8683f379','1.0',NULL,'Y',NULL,'ems','ems','ems',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('eb7edf17-9669-4a3f-8e4d-1a6c1d3e79cf',NULL,'8b0ded4b-5f4f-41e9-a462-9d844dbd4e16','b3be0f48-049b-4eae-a438-469f98d3666a','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('ebe51ba8-e766-4aab-93c9-9dda409f6e84',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ed014da5-013d-4dea-9f77-f1399adfd0c6',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ed202651-4796-4cb4-94ca-382739d41dd4',NULL,'503d60bc-0b02-4a46-8b3f-0d6efa355c6c','1e0ac2af-1887-46e5-adc9-4a6ded8e0b47','1.0',NULL,NULL,NULL,'pd','pd','pd',NULL,NULL,NULL,NULL,NULL,NULL), +('ed8e372b-5893-4f81-ab4c-ad45e6f205b5',NULL,'8d5acbcc-77b0-43ee-9775-8f4cd8fdf949','b50b4639-baf7-4472-9acc-fb576bc007e1','1.0',NULL,'Y',NULL,'xsa','xsa','xsa',NULL,'nd.c4r8d0',NULL,'{ecomp_generated_naming=true}',0,NULL),('ede8fba4-b7ff-4650-a711-6d6207c4b49b',NULL,'f62862e2-1845-4dfa-b957-bc299928f375','14b6b533-f357-493d-a427-53e80dcf699f','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('eec51444-f917-4826-b6a8-e6221c7a90e4',NULL,'c0738051-2a77-48a0-a0fa-dd5d5f8bcc31','2e67a45a-97ea-4e54-87a7-75c2f7ad9163','1.0',NULL,'Y',NULL,'vmxvpfe','vmxvpfe','vmxvpfe',NULL,'ns.c20r16d25.v5',NULL,'{ecomp_generated_naming=true}',0,NULL), +('ef26a5a2-9e4e-42ff-bff4-0f194cb2d972',NULL,'f2c4a5c4-d809-4d19-9c02-308b34e89794','65d44361-202b-4aeb-bf5d-ba318fc1f34d','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('efb0efd8-16c6-4e62-bd3f-522990dff760',NULL,'3d101527-fe50-46e7-bd89-ad99e545d322','729e3ea2-d7e7-4a4f-9516-04bf6df59834','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('efb4a2b2-bc92-4d78-9ffb-bcece5d0ccaf',NULL,'1db9da95-cd4d-4225-ac5a-e919f299989b','000ea3fe-76ca-4f10-9f7e-c65bbd597865','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('efc90207-24b1-47a1-928d-19350791ca47',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('efd437ed-2715-4fe4-a69a-eafc41e7f650',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f016575f-e7d9-4a90-aaf2-e6b429060fa8',NULL,'bd670156-9175-4be4-9fde-09fb49dfac27','097276ed-bb83-4805-9cce-ceda0046fe8f','1.0','gw1218.Config_MS_VmVnfcNamingPolicyMobility1710.*','Y','Consumer Mobile DNS','dns','dns','dns',NULL,NULL,NULL,'{naming_policy=gw1218.Config_MS_VmVnfcNamingPolicyMobility1710.*, ecomp_generated_naming=true}',0,NULL), +('f0277eef-3729-4e66-8c72-a23f933c5c8f',NULL,'504c87bd-4d99-4237-9ef5-823f659f153f','563300b6-3490-443f-acdc-a65b37a0d955','1.0',NULL,NULL,NULL,'cognoscdp','cognoscdp','cognoscdp',NULL,NULL,NULL,NULL,NULL,NULL), +('f0606828-6ceb-497a-863d-b72c9d11fafd',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f0961049-966a-440f-af4c-797befaea852',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f148e42e-d310-464f-9a27-bf3bc7ed2202',NULL,'616633f4-2f25-4d7f-915c-105d97ec1390','e5a4b18a-0f96-4a63-aa75-1b6245e5a98a','1.0',NULL,NULL,NULL,'dns','dns','dns',NULL,NULL,NULL,NULL,NULL,NULL), +('f1f35cf8-0a4e-48c9-a966-513fcf4863f1',NULL,'e96677f3-5e25-4981-ab2e-4717179460e4','87495082-054c-4c08-8701-a2daf1f39d61','1.0',NULL,NULL,NULL,'smp','smp','smp',NULL,NULL,NULL,NULL,NULL,NULL), +('f2a5b03c-dca9-4152-b35e-95da0b2a42bd',NULL,'db32aef7-2854-4c45-b54b-6a8ba9b2a187','9be0230e-8b41-472f-b116-c088031b6461','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('f33b0238-a850-4b95-9078-2561fa509e04',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f39040ec-1feb-4a27-83e4-b5d3f184f896',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','852c4237-cfdd-4695-9e75-bcd4cf7d38a3','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f39128b6-1f38-4ca2-816b-3f15872de0bf',NULL,'fb5f262a-269d-475c-bac2-31b009cdbe38','d5ac0c8f-4461-403b-aeb5-9b67f2ca7248','1.0',NULL,'Y',NULL,'ddc','ddc','ddc','{}','{}',NULL,'{ecomp_generated_naming=true}',0,NULL), +('f4267340-601e-4040-ad87-f915e929a7fa',NULL,'1aa31df4-439a-4dcc-b649-a7ed13510ab4','220a8d4f-d9e1-471e-8bc2-5c54d18de3c5','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('f4906bee-f14a-4d10-ac33-99043205b5db',NULL,'231e7f44-fdbc-40a0-b836-c3302421004d','e66f3e27-27f7-450c-b3b7-cdaf43d262b6','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f4dd3fba-2106-4ba6-b834-b8876f072a3b',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f580e854-ac3d-49d1-b581-80b72f5a2c81',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f59f0b93-65da-4d01-bff6-50733cc8a9db',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('f5b646e3-bdef-4f05-88e8-7f8cbb13d27e',NULL,'11a268da-9a6e-4f39-8794-8de38f6cad63','6f48d61b-58fb-494e-9450-3497531e456d','1.0',NULL,NULL,NULL,'vvig','vvig','vvig',NULL,NULL,NULL,NULL,NULL,NULL), +('f75bbdcd-d848-4a8e-ba4b-5173a7dcbb5a',NULL,'75b03378-7319-418c-95e3-7a596ffa0c3b','b6f636f1-a834-4f24-a036-d0212a053688','2.0',NULL,NULL,NULL,NULL,NULL,NULL,'{}','{}',NULL,NULL,NULL,NULL), +('f7b8a554-4335-45b8-bb61-c0a9b6f3d0ca',NULL,'ea28c4ef-8200-4a97-b78c-c1e56f5089aa','198d7317-ad56-4cc3-9027-7a835f72e547','1.0',NULL,'Y',NULL,'rtp_msc_b','rtp_msc_b','rtp_msc_b',NULL,NULL,NULL,'{ecomp_generated_naming=true}',0,NULL), +('f7d4ccaf-0f34-49e9-bb48-e652ca8a2705',NULL,'72308d7a-5d2b-43d0-ab9d-1839fae15b63','f2c093f3-2f6d-46dd-880d-2831569cdaa9','1.0',NULL,'Y',NULL,'adm','adm','adm','{}','nv.c12r32d320s32',NULL,'{ecomp_generated_naming=true}',0,NULL), +('f7dbd366-3e6f-4078-8f57-0ec005a42aee',NULL,'aedc2b1d-2d46-419a-a100-f19acc5dda4c','b6de808d-1bf1-4445-9096-7184865b90c8','1.0',NULL,NULL,NULL,'guardian','guardian','guardian',NULL,NULL,NULL,NULL,NULL,NULL), +('f84541f8-a56d-4ba6-8f2a-98bf872b4323',NULL,'4788a442-db68-4d49-8086-80881e2ebcaa','c691c12d-4cd4-4f6f-8a8c-eb520242ec39','1.0',NULL,NULL,NULL,'rdn','rdn','rdn',NULL,NULL,NULL,NULL,NULL,NULL), +('f909049f-7457-40d2-83bc-e3a8ce282556',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fa1a48a8-3939-4994-bc74-d57cc601e44a',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fa606398-23cc-49c2-94f0-92b2ab6a4bb8',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fb29bfb6-5885-44d4-b792-c8bbf74127f9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fbc1a5aa-361c-4ebf-838f-e50784d09fc9',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fcaa6830-e5d2-4e51-8b2a-142ce5795ca9',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fe0adb9f-6a53-4f5f-814a-7fd4a1f94aff',NULL,'dd3b80d2-2bd5-447e-a477-c545cb5f12a3','d5d27789-37b3-48f7-9938-7b013b2d79a8','1.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fe402490-fa32-48fa-9b64-c1be9feaeba8',NULL,'28602f11-3e2a-4d19-8e0e-2f85a5256f69','9a3db35a-1416-4016-912a-afa57590ef6d','1.0',NULL,NULL,NULL,'eca_trx','eca_trx','eca_trx',NULL,NULL,NULL,NULL,NULL,NULL), +('fe5506eb-2cab-49d0-98aa-3f6e7af62928',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fea5c677-4b8b-492f-a23d-665020923070',NULL,'d10dcdb7-3f52-4303-a078-11d769ef33f4','c07f11c8-fccd-477c-bb70-5b7f939b3f08','3.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('fee32e95-4d59-4fb6-bb30-88f63752400f',NULL,'0ba8c32b-e413-494b-afe2-2b10ccfa5ee6','535e57f2-7913-4947-852a-dcd3a9020424','1.0',NULL,NULL,NULL,'nat_fw','nat_fw','nat_fw',NULL,NULL,NULL,NULL,NULL,NULL),('fef42f2f-7105-4d25-b5ea-d0488ba413b8',NULL,'b8098e5a-a3eb-4758-a311-729fbcbaa8ee','5c712825-6389-4664-aeb0-0837faa5d9ad','1.0',NULL,NULL,NULL,'managementui','managementui','managementui',NULL,NULL,NULL,NULL,NULL,NULL), +('fef48cfb-de1f-4482-b6fc-72cd47fa0998',NULL,'8b45ff14-14ca-4e2f-9ec5-2d957bc0ce93','b425cf93-ca33-41e6-ba92-ce78501ac44e','13.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('ff739f94-f33c-4a27-a84e-7ea813bf2e7c',NULL,'1c2f2b6f-dadd-491e-b0bf-91eb8b97e524','d8ae78d3-880d-4a1a-a3af-64bd3077596b','1.0',NULL,NULL,NULL,'ps','ps','ps',NULL,NULL,NULL,NULL,NULL,NULL), +('vnfapi-vfc-001',NULL,'vnfapi-invariant-vnf-001','vfc-001','v1','vfc-policy-001','Y',NULL,'vfc1','vlc','vlc',NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/ms/generic-resource-api/src/test/resources/dblib.properties b/ms/generic-resource-api/src/test/resources/dblib.properties new file mode 100644 index 0000000..198a00c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/dblib.properties @@ -0,0 +1,38 @@ +### +# ============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========================================================= +### + +# dblib.properrties +org.onap.ccsdk.sli.dbtype=jdbc + +org.onap.ccsdk.sli.jdbc.hosts=localhost +org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true +org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver +org.onap.ccsdk.sli.jdbc.database = sdnctl +org.onap.ccsdk.sli.jdbc.user = sdnctl +org.onap.ccsdk.sli.jdbc.password = abc123 +org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 +org.onap.ccsdk.sli.jdbc.connection.timeout=50 +org.onap.ccsdk.sli.jdbc.request.timeout=100 +org.onap.ccsdk.sli.jdbc.limit.init=10 +org.onap.ccsdk.sli.jdbc.limit.min=10 +org.onap.ccsdk.sli.jdbc.limit.max=20 +org.onap.dblib.connection.recovery=false + diff --git a/ms/generic-resource-api/src/test/resources/service-assign-rpc.json b/ms/generic-resource-api/src/test/resources/service-assign-rpc.json new file mode 100644 index 0000000..a78e1af --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/service-assign-rpc.json @@ -0,0 +1,53 @@ +{ + "input": { + "request-information": { + "notification-url": "http://dev.null", + "order-number": "123", + "order-version": "version1", + "request-action": "CreateServiceInstance", + "request-id": "req123", + "source": "curl" + }, + "sdnc-request-header": { + "svc-action": "assign", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svcreq123" + }, + "service-information": { + "global-customer-id": "cust123", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "service1", + "service-instance-id": "service1", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "service-request-input": { + "service-input-parameters": { + "param": [ + { + "name": "test-param", + "resource-resolution-data": { + "capability-name": "no-op", + "payload": "hello-world", + "resource-key": [ + { + "name": "key", + "value": "value" + } + ], + "status": "pending" + }, + "value": "hello-world" + } + ] + }, + "service-instance-name": "service-instance-2" + } + } + } diff --git a/ms/generic-resource-api/src/test/resources/svclogic.properties b/ms/generic-resource-api/src/test/resources/svclogic.properties index 95f4c8a..8f5243e 100644 --- a/ms/generic-resource-api/src/test/resources/svclogic.properties +++ b/ms/generic-resource-api/src/test/resources/svclogic.properties @@ -23,7 +23,7 @@ org.onap.ccsdk.sli.dbtype = jdbc org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver org.onap.ccsdk.sli.jdbc.database = sdnctl -org.onap.ccsdk.sli.jdbc.user = sdnc +org.onap.ccsdk.sli.jdbc.user = sdnctl org.onap.ccsdk.sli.jdbc.password = abc123 serviceLogicDirectory=target/docker-stage/opt/onap/sdnc/svclogic/graphs/generic-resource-api diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml new file mode 100755 index 0000000..5f174c6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml @@ -0,0 +1,124 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='aai-get-aic-zone' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='' />
+ <parameter name='aaiapi.output.complex-name' value='' />
+ <parameter name='aaiapi.output.aic-clli' value='' />
+ </set>
+ <switch test='`$aaiapi.input.cloud-owner`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$aaiapi.input.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $aaiapi.input.cloud-owner AND
+ cloud-region.cloud-region-id = $aaiapi.input.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving cloud region from AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='aaiapi.output.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' ></get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='`$aai.cloud-region.cloud-zone`' />
+ <parameter name='aaiapi.output.complex-name' value='`$aai.cloud-region.complex-name`' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml new file mode 100755 index 0000000..7383c3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml @@ -0,0 +1,95 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='aai-get-network-instance-group' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='' />
+ <parameter name='aaiapi.output.collection-name' value='' />
+ <parameter name='aaiapi.output.collection-function' value='' />
+ <parameter name='aaiapi.output.collection.collection-id' value='' />
+ </set>
+ <switch test='`$aaiapi.input.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $aaiapi.input.network-instance-group-id"
+ local-only="false"
+ pfx="tmp.AnAI.networkInstanceGroup">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving network instance group with id=' + $aaiapi.input.network-instance-group-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship_length`" >
+ <for silentFailure='true' index='rdidx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='collection.collection-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection.collection-id' value='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$aaiapi.output.collection.collection-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + ' collection not found in AnAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aaiapi.output.collection.collection-id"
+ local-only="false"
+ pfx="tmp.AnAI.collection">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving collection with id=' + $aaiapi.output.collection.collection-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'collection: ' + $aaiapi.output.collection.collection-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='`$tmp.AnAI.collection.collection-customization-id`' />
+ <parameter name='aaiapi.output.collection-name' value='`$tmp.AnAI.collection.collection-name`' />
+ <parameter name='aaiapi.output.collection-function' value='`$tmp.AnAI.collection.collection-function`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml new file mode 100644 index 0000000..658cee1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml @@ -0,0 +1,560 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='api-contrail-route-topology-operation-activate' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$src-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='src-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='apply' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to apply policy in Contrail to source network" /> + </return> + </outcome> + </execute> + <switch test='`$ar-assignments.dest-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Destination network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$dest-default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$dest-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='dest-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='apply' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to apply policy in Contrail to destination network" /> + </return> + </block> + </outcome> + </execute> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].related-link" +value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.source-network.network-id`" /> + <parameter name="relationship-list.relationship[1].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[1].related-link" +value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.dest-network.network-id`" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="in-service-path" /> + <parameter name="orchestration-status" value="activated" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml new file mode 100644 index 0000000..674e547 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml @@ -0,0 +1,1443 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='api-contrail-route-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='cto-api.owning-entity' />
+ <parameter name='field24' value='`$cto-api.owning-entity`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ <parameter name="ar-request-information." value="" />
+ <parameter name="ar-created" value="" />
+ <parameter name="ar-aai-created" value="" />
+ <parameter name="np-aai-created" value="" />
+ <parameter name="contrail-created" value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-l3-network" value="" />
+ <parameter name="ctotmp.num-s-network" value="0" />
+ <parameter name="ctotmp.s-network-policy" value="" />
+ <parameter name="ctotmp.num-s-np" value="0" />
+ <parameter name="ctotmp.c-l3-network" value="" />
+ <parameter name="ctotmp.num-c-network" value="0" />
+ <parameter name="ctotmp.c-network-policy" value="" />
+ <parameter name="ctotmp.num-c-np" value="0" />
+ <parameter name="ctotmp.s-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.c-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.network-policy-id" value="" />
+ <parameter name="ctotmp.action" value="create" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.source-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.source-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get source network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.sidx' start='0' end='`$ctotmp.aai.source-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-network-policy-list[$ctotmp.num-s-np].network-policy-id" value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-s-np" value="`$ctotmp.num-s-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-network-policy-list_length" value="`$ctotmp.num-s-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-l3-network." value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.`" />
+ <parameter name="ctotmp.num-s-network" value="`$ctotmp.num-s-network+1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-s-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.source-network.network-id" value="`$ctotmp.s-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for source network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.collector-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.collector-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get collector network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.cidx' start='0' end='`$ctotmp.aai.collector-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-l3-network." value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.`" />
+ <parameter name="ctotmp.num-c-network" value="`$ctotmp.num-c-network+1`" />
+ </set>
+ <for index='ridx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="collector-service-instance-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='network-policy'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='network-policy.network-policy-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-network-policy-list[$ctotmp.num-c-np].network-policy-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-c-np" value="`$ctotmp.num-c-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.c-network-policy-list_length" value="`$ctotmp.num-c-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-c-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.dest-network.network-id" value="`$ctotmp.c-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for collector network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ctotmp.spidx' start='0' end='`$ctotmp.s-network-policy-list_length`' >
+ <for index='ctotmp.cpidx' start='0' end='`$ctotmp.c-network-policy-list_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id == $ctotmp.c-network-policy-list[$ctotmp.cpidx].network-policy-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.network-policy-id" value="`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id`" />
+ <parameter name="ctotmp.existing-network-policy-found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <switch test='`$ctotmp.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="existing policy - error" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar-request-information.source' value="SDNC" />
+ </set>
+ <set>
+ <parameter name='ar-contrail-route-request-input.source-network.network-role' value="`$cto-api.source-network-role`" />
+ <parameter name='ar-contrail-route-request-input.source-network.network-id' value="`$ctotmp.source-network.network-id`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-role' value="`$cto-api.collector-network-role`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-id' value="`$ctotmp.dest-network.network-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-allottedresource-id' mode='sync' ></call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='ar-identifiers.allotted-resource-type' value="contrail-route" />
+ <parameter name='ar-identifiers.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <parameter name='ar-identifiers.consuming-service-instance-id' value="`$cto-api.service-instance-id` " />
+ <parameter name="tmp.ar.allotted-resource-id" value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='tmp.ar.allotted-resource-type' value="contrail-route" />
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <!-- <parameter name='tmp.ar.contrail-applied-service-instance-id' value='' /> -->
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network`"/>
+ <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Existing contrail route allotted resource" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <!--
+<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /><parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /><parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+-->
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$source-network-name_$cloud-region-id_$source-network-role_$collector-network-role _policy_' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-name"/>
+ <parameter name="replacement" value="`$ctotmp.s-l3-network.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$cloud-region-id"/>
+ <parameter name="replacement" value="`$cto-api.cloud-region-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-role"/>
+ <parameter name="replacement" value="`$cto-api.source-network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$collector-network-role"/>
+ <parameter name="replacement" value="`$cto-api.collector-network-role`"/>
+ </execute>
+ <set>
+ <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
+ <parameter name='generate-unique-name-input.index-length' value='2' />
+ </set>
+ <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="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="generate-unique-name-input.prefix" />
+ <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
+ </record>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.'
+value="`$ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='ar-assignments.source-network.network-id' value="`$ctotmp.s-l3-network.network-id` " />
+ <parameter name='ar-assignments.source-network.network-role' value="`$cto-api.source-network-role` " />
+ <parameter name='ar-assignments.dest-network.network-id' value="`$ctotmp.c-l3-network.network-id` " />
+ <parameter name='ar-assignments.dest-network.network-role' value="`$cto-api.collector-network-role` " />
+ </set>
+ <set>
+ <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultDomain"/>
+ <parameter name="replacement" value="`$cto-api.default-domain`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultProject"/>
+ <parameter name="replacement" value="`$cto-api.default-project`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$sdncNetworkPolicy"/>
+ <parameter name="replacement" value="`$tmp.ar-name`"/>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <switch test='`$cto-api.isTest`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='<>' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='<>' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='TESTcreate' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field10' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field12' value='<>' />
+ <parameter name='field13' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="dummy12345" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='<>' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='<>' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.'
+value="`$ar-assignments.`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <!-- Create network-policy object -->
+ <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" />
+ <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="np-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save network-policy in AAI"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $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="Failed to save network-policy in AAI"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $cto-api.service-type AND
+ service-instance.service-instance-id = $cto-api.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="id" value="`$tmp.ar.allotted-resource-id`" />
+ <parameter name="description" value="`$tmp.ar.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="order-status" value="Created" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save allotted resource in AAI"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $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="Failed to save allotted resource in AAI"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+ <parameter name='tmp.found-cidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tmp.ar.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='cto-api.contrail-route-allotted-instance-id' value='`$tmp.ar.allotted-resource-id`' />
+ </set>
+ <set>
+ <parameter name='ctotmp.' value='' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml new file mode 100644 index 0000000..c49f2eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml @@ -0,0 +1,618 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='api-contrail-route-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Active'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$src-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='src-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from source network" /> + </return> + </outcome> + </execute> + <switch test='`$ar-assignments.dest-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Dest network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$dest-default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$dest-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='dest-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" /> + </return> + </block> + </outcome> + </execute> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " > + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + </delete> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <parameter name="orchestration-status" value="deactivated" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml new file mode 100644 index 0000000..d1ef588 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml @@ -0,0 +1,332 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='api-contrail-route-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-delete"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='service-data.service-information.global-customer-id' />
+ <parameter name='field24' value='`$service-data.service-information.global-customer-id`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.action" value="delete" />
+ <parameter name="ctotmp.config-count" value="0" />
+ <parameter name="ctotmp.config-found" value="true" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id"
+ pfx='aai.ar' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <switch test='`$cto-api.rollback-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.ar.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.ar.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='configuration.configuration-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-count' value='`$ctotmp.config-count+1`' />
+ </set>
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $cto-api.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$ctotmp.config-count > 1`">
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted Resource is tied to more than one configuration object" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ctotmp.config-count == 1 and $ctotmp.config-found == 'true'`">
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted resource is not tied to configuration object" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$cto-api.contrail-route-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to delete policy in Contrail" />
+ </return>
+ </outcome>
+ </execute>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to delete network policy in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to delete network policy in AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </delete>
+ <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.sdidx" value="`$snidx`"/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.consumed-allotted-resources." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml new file mode 100755 index 0000000..f23891c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml @@ -0,0 +1,441 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='assign-vlan-tags' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.`' />
+ </set>
+ <set>
+ <parameter name='total-subs' value='`$get-data-from-policy-output.precreate-sub-intf-num`' />
+ </set>
+ <switch test='`$total-subs > ( $tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf )`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='total-subs' value='`$tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='cur-tag-id' value='`$get-data-from-policy-output.vlan-tag-start + $get-data-from-policy-output.vlan-tag-offset`' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='0' />
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <while test='`$total-subs > 0`'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id'
+ value='`$cur-tag-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length'
+ value='`$sub-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-tag-id' value='`$cur-tag-id + 1`' />
+ </set>
+ <set>
+ <parameter name='vnic-index' value='`$vnic-index + 1`' />
+ </set>
+ <switch test='`$vnic-index == $tmp.vlan-vnics.vlan-vnic_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='`$sub-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='total-subs' value='`$total-subs - 1`' />
+ </set>
+ </block>
+ </while>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].network-collection-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-instance-group-id' value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ </set>
+ <set>
+ <parameter name='network-instance-group-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$network-instance-group-id
+== $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-instance-group-index' value='`$nig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-instance-group-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network instance group ID '
+ + $network-instance-group-id
+ + ' in network-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-index' value='-1' />
+ <parameter name='unassigned-network-index' value='-1' />
+ </set>
+ <for index='n-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id
+ == $service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].vlan-tag-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-index' value='`$n-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$unassigned-network-index`">
+ <outcome value='-1'>
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].network-status`'>
+ <outcome value='unassigned'>
+ <set>
+ <parameter name='unassigned-network-index' value='`$n-index`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-index`'>
+ <outcome value='-1'>
+ <switch test='`$unassigned-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="L3-network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].vlan-tag-id'
+ value='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id`' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-status'
+ value='assigned' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$network-index].network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <for index='n-index' start='0' end='`$service-data.networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id
+ == $service-data.networks.network[$n-index].network-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-name`' />
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-role'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-role`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to find a network name for network id '
+ + $service-data.networks.network[$n-index].network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-collection' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$idx].network-instance-group-function
+ == $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-collection' value='true' />
+ </set>
+ <set>
+ <parameter name='vnc-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-collection`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find vnf-network-collection for network-instance-group-function '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$idx].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='nig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-instance-group for network-instance-group-id '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv4' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'34.52.87.1' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='4' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v4'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv6' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='6' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'cafe:1111' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='6' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v6'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.'
+ value='`$tmp.vlan-vnics.`' />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml new file mode 100644 index 0000000..77fdb44 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml @@ -0,0 +1,1593 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='auto-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <switch test='`$auto-ip-assignment-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module.model-customization-uuid`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module.model-customization-uuid is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.service-instance-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $auto-ip-assignment-input.vf-module.model-customization-uuid'
+ pfx='db1.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vnf-topology-operation-input.vnf-request-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $auto-ip-assignment-input.vf-module.model-customization-uuid
+ AND vm_count > 0'
+ pfx='db1.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $auto-ip-assignment-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value = '0' />
+ <parameter name='query-aai-l3-network-by-network-role-output.' value = '' />
+ </set>
+ <set>
+ <parameter name='qridx' value = '0' />
+ </set>
+ <set>
+ <parameter name='pidx' value = '0' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.' value = '' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role-tag' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
+ </set>
+ <block atomic='true'>
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-floating-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <block atomic="true">
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-floating-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-floating-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <switch test='`$eipam-ip-block.plans_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$auto-ip-assignment-input.service-type`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.service-information.service-type' value='NA' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while obtaining ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml new file mode 100644 index 0000000..9417333 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml @@ -0,0 +1,266 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='bbs-access-connectivity-network-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' /> + <parameter name='prop.bbs.HsiPackage' value='50M' /> + <parameter name='prop.bbs.HsiType' value='IPoE' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <for index='idx' start='0' end='`$network-input-parameters.param_length`' > + <block> + <switch test="`$network-input-parameters.param[$idx].name == 'remote_id'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ONTSN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ONTSN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'CVLAN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.CVLAN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'SVLAN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.SVLAN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="put"/> + <parameter name="responsePrefix" value="token-result"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <outcome value='success'> + <switch test='`$token-result.accessSession`'> + <outcome value='Other'> + <set> + <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error executing queryTokenID,vaule is null" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call queryTokenID" /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-access-connectivity-create.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call createAccessConnectivityService" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error createAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block> + <set> + <parameter name='prop.bbs.serviceID' value="`$service-result.accessE2Eservice.serviceID`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "AccessConnectivity"/> + <parameter name= "service-id" value = "`$network-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data" + > + <parameter name="metadata.metadatum[0].metaname" value="remote-id" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.remote_id`" /> + <parameter name="metadata.metadatum[1].metaname" value="controller-service-id" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.serviceID`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..75d15b5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml @@ -0,0 +1,171 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-access-connectivity-network-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for index='idx' start='0' end='`$network-input-parameters.param_length`' >
+ <switch test="`$network-input-parameters.param[$idx].name == 'serviceID'`">
+ <outcome value='true'>
+ <switch test='`$network-input-parameters.param[$idx].value`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.serviceID' value='`$network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="$network-input-parameters.param[$idx].name +' value is null, please check it.'" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/DeactivateOnt?serviceID='+$prop.bbs.serviceID`" />
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="contentType" value="application/x-www-form-urlencoded"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call deleteAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error deleteAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='AccessConnectivity'>
+ <set>
+ <parameter name='prop.bbs.accessConnectivityVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.accessConnectivityVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml new file mode 100644 index 0000000..2ba5835 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,288 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='bbs-access-connectivity-vnf-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call> + <set> + <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' /> + <parameter name='prop.bbs.HsiPackage' value='50M' /> + <parameter name='prop.bbs.HsiType' value='IPoE' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' > + <block> + <switch test="`$vnf-input-parameters.param[$idx].name == 'remote_id'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'ONTSN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ONTSN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'CVLAN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.CVLAN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'SVLAN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.SVLAN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="put"/> + <parameter name="responsePrefix" value="token-result"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <!--<parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>--> + <outcome value='success'> + <switch test='`$token-result.accessSession`'> + <outcome value='Other'> + <set> + <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error executing queryTokenID,vaule is null" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call queryTokenID" /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-access-connectivity-create.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <!--<parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" />--> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call createAccessConnectivityService" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error createAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block> + <set> + <parameter name='prop.bbs.serviceID' value="`$service-result.accessE2Eservice.serviceID`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + <!--<set>--> + <!--<parameter name='vnf-id' value="123456789"/>--> + <!--<parameter name='vnf-name' value="vnf_name"/>--> + </set> + <record plugin='org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder'> + <parameter name='logger' value='message-log'/> + <parameter name='field1' value='`$vnf-id`'/> + <parameter name='field2' value='`$vnf-name`'/> + <!--<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">--> + <!-- <parameter name="file" value="/root/logx.txt" />--> + <!-- <parameter name="field1" value="deleteAccessConnectivityService success!" />--> + <!-- <parameter name="field2" value='`$topology.networks.network[0].network-types`' />--> + </record> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "AccessConnectivity"/> + <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data" + > + <parameter name="metadata.metadatum[0].metaname" value="remote-id" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.remote_id`" /> + <parameter name="metadata.metadatum[1].metaname" value="controller-service-id" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.serviceID`" /> + <parameter name="metadata.metadatum[2].metaname" value="cvlan" /> + <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.CVLAN`" /> + <parameter name="metadata.metadatum[3].metaname" value="svlan" /> + <parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.SVLAN`" /> + <parameter name="metadata.metadatum[4].metaname" value="expected-ont-id" /> + <parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.ONTSN`" /> + <!--<parameter name="metadata.metadatum[5].metaname" value="rgw-mac-address" />--> + <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.mac`" />--> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..3b98365 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,225 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'serviceID'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.serviceID' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="$vnf-input-parameters.param[$idx].name +' value is null, please check it.'" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/DeactivateOnt?serviceID='+$prop.bbs.serviceID`" />
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="contentType" value="application/x-www-form-urlencoded"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call deleteAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error deleteAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='AccessConnectivity'>
+ <set>
+ <parameter name='prop.bbs.accessConnectivityVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='rix' start='0' end="`$aai.service-instance.metadata.metadatum_length`" >
+ <switch test='`$aai.service-instance.metadata.metadatum[$rix].metaname`'>
+ <outcome value='remote-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='controller-service-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='cvlan'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='svlan'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='expected-ont-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.accessConnectivityVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml new file mode 100644 index 0000000..37bb23d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml @@ -0,0 +1,42 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='bbs-internet-profile-network-topology-operation-change-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call ChangeInternetProfileInstance" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error ChangeInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block></block> + </outcome> + </switch> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml new file mode 100644 index 0000000..d41dfd5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml @@ -0,0 +1,166 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='http://172.30.0.121:5000' /> + <parameter name='prop.bbs.service_id' value='`$network-topology-operation-input.service-information.service-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <for index='idx' start='0' end='`$network-input-parameters.param_length`' > + <block> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_remote_id'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ont_sn'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ont_sn' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_service_type'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.service_type' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_rg_mac_addr'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.mac' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_upstream_speed'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.up_speed' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_downstream_speed'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.down_speed' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 's_vlan'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.s_vlan' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'c_vlan'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.c_vlan' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml new file mode 100644 index 0000000..2d88b3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml @@ -0,0 +1,146 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='bbs-internet-profile-network-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call CreateInternetProfileInstance" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error CreateInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block></block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "InternetProfile"/> + <parameter name= "service-id" value = "`$network-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="metadata.metadatum[0].metaname" value="service-type" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.service_type`" /> + <parameter name="metadata.metadatum[1].metaname" value="up-speed" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.up_speed`" /> + <parameter name="metadata.metadatum[2].metaname" value="down-speed" /> + <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.down_speed`" /> + <parameter name="metadata.metadatum[3].metaname" value="cvlan" /> + <parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.c_vlan`" /> + <parameter name="metadata.metadatum[4].metaname" value="svlan" /> + <parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.s_vlan`" /> + <parameter name="metadata.metadatum[5].metaname" value="expected-ont-id" /> + <parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.ont_sn`" /> + <parameter name="metadata.metadatum[6].metaname" value="rgw-mac-address" /> + <parameter name="metadata.metadatum[6].metaval" value="`$prop.bbs.mac`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..ea6dde9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml @@ -0,0 +1,84 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-internet-profile-network-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/DeleteInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call DeleteInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error DeleteInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='InternetProfile'>
+ <set>
+ <parameter name='prop.bbs.internetProfileVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.internetProfileVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml new file mode 100644 index 0000000..4aa36b9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml @@ -0,0 +1,44 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call ChangeInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error ChangeInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'></call>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml new file mode 100644 index 0000000..4f67b46 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml @@ -0,0 +1,76 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='http://172.30.0.121:5000' />
+ <parameter name='prop.bbs.service_id' value='`$vnf-topology-operation-input.service-information.service-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <block>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_service_type'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.service_type' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_upstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.up_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_downstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.down_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml new file mode 100644 index 0000000..fb07393 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,150 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <!--<parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call CreateInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error CreateInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.random-data"/>
+ <outcome value='success'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="ctx_memory_result_key" value="prop.random-data-list"/>
+ <parameter name="original_string" value="`$prop.random-data`"/>
+ <parameter name="regex" value="-"/>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/>
+ <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/>
+ <!--<set>-->
+ <!--<parameter name='vnf-id' value="123456789"/>-->
+ <!--<parameter name='vnf-name' value="vnf_name"/>-->
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" >
+ <parameter name= "vnf-id" value = "`$vnf-id`"/>
+ <parameter name= "vnf-name" value = "`$vnf-name`"/>
+ <parameter name= "vnf-type" value = "InternetProfile"/>
+ <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/>
+ <parameter name= "prov-status" value = "ACTIVE"/>
+ <parameter name= "orchestration-status" value = "Active"/>
+ <parameter name= "is-closed-loop-disabled" value = "false" />
+ <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/>
+ <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/>
+ <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save generic-vnf" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generic-vnf instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="metadata.metadatum[0].metaname" value="service-type" />
+ <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.service_type`" />
+ <parameter name="metadata.metadatum[1].metaname" value="up-speed" />
+ <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.up_speed`" />
+ <parameter name="metadata.metadatum[2].metaname" value="down-speed" />
+ <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.down_speed`" />
+ <!--<parameter name="metadata.metadatum[3].metaname" value="cvlan" />-->
+ <!--<parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.c_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[4].metaname" value="svlan" />-->
+ <!--<parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.s_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[5].metaname" value="expected-ont-id" />-->
+ <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.ont_sn`" />-->
+ <!--<parameter name="metadata.metadatum[6].metaname" value="rgw-mac-address" />-->
+ <!--<parameter name="metadata.metadatum[6].metaval" value="`$prop.bbs.mac`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..cebb55f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,143 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='delete'>
+ <block atomic='true'>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/DeleteInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call DeleteInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error DeleteInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='InternetProfile'>
+ <set>
+ <parameter name='prop.bbs.internetProfileVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='rix' start='0' end="`$aai.service-instance.metadata.metadatum_length`" >
+ <switch test='`$aai.service-instance.metadata.metadatum[$rix].metaname`'>
+ <outcome value='service-type'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='up-speed'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='down-speed'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.internetProfileVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml new file mode 100644 index 0000000..5e1fbe7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml @@ -0,0 +1,333 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-activate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<!--
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+-->
+
+</set><block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs' pfx='tmp.vnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.vnfdata.vnfs.vnf-list_length`' >
+
+
+<switch test='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id == $tmp.ar.parent-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.ar.brg-vnf-id'
+ value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+
+
+
+</set></block></outcome></switch></for></block><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $brg-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" >
+</get-resource><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+</set><set>
+<parameter name='tmp.ar.consuming-service-instance-id' value='`$brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+</set><call module='GENERIC-RESOURCE-API' rpc='get-tunnelxconn-ar' mode='sync' >
+</call><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip`"/>
+</execute><set>
+<parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip` " />
+<parameter name='tmp.tunnel-dest-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip` " />
+<parameter name='tmp.tunnel-src-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip` " />
+<parameter name='tmp.tunnel-vni' value="`$brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vni` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+</return></outcome></execute><set>
+<parameter name='tmp.bridge-domain' value="bridge-domain-10" />
+<parameter name='tmp.split-horizon-group' value="2" /></set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.bridge-domain.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up bridge domain" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up bridge domain" />
+</return></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+</set><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`' />
+</set><set>
+<parameter name='tmp.search.consuming-service-instance-id' value='`$brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+ </set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='preload-vnfs' pfx='tmp.preloadvnfdata' >
+<!--
+tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[1].preload-data[0].vnf-topology-information.vnf-parameters[16].vnf-parameter-value = 10.0.101.30
+--><outcome value='success'>
+<block>
+<set>
+<parameter name='tmp.brg-match-vnf-name' value="`'VGW2BRG-'+ $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address`" />
+
+</set><for index='vnfidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list_length`' >
+
+
+
+<block>
+<switch test='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name == $tmp.brg-match-vnf-name`'>
+
+
+<outcome value='true'>
+<for index='paramidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters_length`' >
+
+
+<switch test="`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == 'vgw_private_ip_1'`" >
+
+
+<outcome value='true'>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip'
+ value="`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`" />
+
+</set></outcome></switch></for></outcome></switch></block></for></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+</return></outcome></get-resource><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip`"/>
+</execute><set>
+<parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+<parameter name='tmp.tunnel-dest-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+<parameter name='tmp.tunnel-src-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip` " />
+<parameter name='tmp.tunnel-vni' value="`$brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vni` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-api.service-information`"/>
+ <parameter name="outputPath" value="tmp.vnf-api-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.brg-vnf-id`"/>
+
+ <!--
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`"/>
+ -->
+ <!--
+ <parameter name="replacement" value="`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`"/>
+-->
+<!--
+brg-ar.allotted-resource-data.brg-topology.brg-assignments
+--></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-api-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="service-data" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-service-data' value='$service-data.' />
+</set><switch test='`$service-data.service-data_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.service-data.' value='$service-data.service-data[0].' />
+</set><switch test='`$tmp.service-data.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tmp.service-data.service-information.service-instance-id' value='`$brg-topology-operation-input.service-information.service-instance-id`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.services`"/>
+ <parameter name="outputPath" value="tmp.services-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-data.service-information.service-instance-id`"/>
+<!-- tmp.service-data.service-information.service-instance-id
+brg-topology-operation-input.allotted-resource-information.parent-service-instance-id
+brg-topology-operation-input.service-information.service-instance-id
+
+--></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.services.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.services-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-data.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+ <!--
+brg-topology-operation-input.allotted-resource-information.parent-service-instance-id
+
+ brg-topology-operation-input.service-information.service-instance-id
+ -->
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml new file mode 100644 index 0000000..21f0efb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml @@ -0,0 +1,227 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='brg-allotted-resources/brg-allotted-resource/$brg-topology-operation-input.allotted-resource-information.allotted-resource-id/' pfx='mdsal-ar' >
+<outcome value='Other'>
+<block atomic="true">
+<set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set><set>
+<parameter name='brg-ar-identifiers.consuming-service-instance-id' value="`$brg-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='brg-ar-identifiers.parent-service-instance-id' value="`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='brg-ar-identifiers.allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='brg-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.brg-topology.onap-model-information.'
+value="`$brg-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_network_policy'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.'
+value="`$brg-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='brg-ar-assignments.vbrg-wan-ip' value='127.0.0.1'/>
+</set><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.'
+value="`$brg-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set><break></break></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
+<outcome value='false'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+</set></block></outcome></switch></block></outcome></switch><set>
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $brg-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+
+<outcome value='success'>
+<block></block></outcome><outcome value='failure'>
+<block></block></outcome><outcome value='not-found'>
+<block></block></outcome></execute></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></outcome></get-resource></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml new file mode 100644 index 0000000..54c99cb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml @@ -0,0 +1,100 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-create' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='PendingCreate'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml new file mode 100644 index 0000000..0fda417 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml @@ -0,0 +1,275 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='brg-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/brg-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-brg-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+ </set>
+ <switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+ <parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+ <parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND service-instance.service-instance-id = $brg-topology-operation-input.service-information.service-instance-id AND allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.consuming-service-instance-id' value='`$allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-tunnelxconn-ar' mode='sync' ></call>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vgmux-lan-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error deleting vxlan tunnel" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error deleting vxlan tunnel" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+ </set>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services' pfx='tmp.servicedata' >
+ <outcome value='success'>
+ <for index='serviceidx' start='0' end='`$tmp.servicedata.services.service_length`' >
+ <switch test='`$tmp.servicedata.services.service[$serviceidx].service-instance-id == $tmp.search.consuming-service-instance-id`'>
+ <outcome value='true'>
+ <for index='vnfidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf_length`' >
+ <for index='vfmoduleidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module_length`' >
+ <for index='paramidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param[$paramidx].name == vgw_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip' value='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $brg-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml new file mode 100644 index 0000000..40effac --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml @@ -0,0 +1,105 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-delete' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='brg-ar-assignments.' value="" />
+
+
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml new file mode 100644 index 0000000..0a01dd9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml @@ -0,0 +1,81 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-unassign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml new file mode 100644 index 0000000..90a9389 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml @@ -0,0 +1,26 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-brg-input' mode='sync' >
+</call><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml new file mode 100644 index 0000000..7376942 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml @@ -0,0 +1,94 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='connection-attachment-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-connection-attachment-input' mode='sync' ></call>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='delete'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml new file mode 100755 index 0000000..06756c6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml @@ -0,0 +1,341 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='contrail-route-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
+ </set>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="related-link"
+key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
+local-only="true"
+pfx="tmp.AnAI-src">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="related-link"
+key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+local-only="true"
+pfx="tmp.AnAI-dest">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy:relationship-list"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`tmp.AnAI-src.related-link`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`tmp.AnAI-dest.related-link`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml new file mode 100755 index 0000000..444b50d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml @@ -0,0 +1,981 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation-assign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.contrail-applied-service-instance-id' value='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`' /> + <parameter name='tmp.ar.allotted-resource-type' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network`"/> + <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.vnf`"/> + <parameter name="outputPath" value="tmp.ar-contrailappliedsvc-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.contrail-applied-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.parent-ar-url`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: Existing contrail route allotted resource" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-identifiers.consuming-service-instance-id' value="`$contrail-route-topology-operation-input.service-information.service-instance-id` " /> + <parameter name='ar-identifiers.parent-service-instance-id' value="`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id` " /> + <parameter name='ar-identifiers.allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + </set> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.' +value="`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.`" /> + </set> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'> + <outcome value=''> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-invariant-uuid' +value="`$ar-model.invariant-uuid`" /> + </set> + </outcome> + </switch> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'> + <outcome value=''> + <set> + <parameter name='sar.allotted-resource-data.contrail-route-topology.onap-model-information.model-uuid' +value="`$ar-model.uuid`" /> + </set> + </outcome> + </switch> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-version'> + <outcome value=''> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-version' +value="`$ar-model.version`" /> + </set> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='source-network-found' value='false' /> + </set> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <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="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="service-data-network-id" /> + <parameter name="field5" value="`$service-data.networks.network[$nidx].network-id`" /> + <parameter name="field6" value="contrail-route-input-network-id" /> + <parameter name="field7" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`" /> + <parameter name="field8" value="`$nidx`" /> + </record> + <switch test="`$service-data.networks.network[$nidx].network-id == $contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' /> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + <parameter name='source-network-found' value='true' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="tenant" + key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND + cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND + tenant.tenant-id = $tmp.ar.tenant-id" + pfx='aai.tenant' local-only='false' > + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' /> + </set> + </block> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </block> + </for> + <switch test="`$source-network-found`"> + <outcome value='false'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$ar-model.ecomp-generated-naming`'> + <outcome value='Y'> + <block atomic="true"> + <switch test='`$ar-model.naming-policy`'> + <outcome value='oam_network_policy'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantName"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$CloudRegionID"/> + <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/> + </execute> + <set> + <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' /> + <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' /> + <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' /> + <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" /> + <parameter name='generate-unique-name-input.index-length' value='2' /> + </set> + <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="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="generate-unique-name-input.prefix" /> + <parameter name="field5" value="`$generate-unique-name-input.prefix`" /> + </record> + <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$generate-unique-name-output.error-message`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' /> + </set> + </outcome> + </call> + <set> + <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantName"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$CloudRegionID"/> + <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/> + </execute> + <set> + <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' /> + <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' /> + <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' /> + <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" /> + <parameter name='generate-unique-name-input.index-length' value='2' /> + </set> + <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="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="generate-unique-name-input.prefix" /> + <parameter name="field5" value="`$generate-unique-name-input.prefix`" /> + </record> + <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$generate-unique-name-output.error-message`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' /> + </set> + </outcome> + </call> + <set> + <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.' +value="`$ar-identifiers.`" /> + </set> + <set> + <parameter name='ar-assignments.source-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.` " /> + <parameter name='ar-assignments.dest-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.` " /> + <parameter name='ar-assignments.contrail-applied-service.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.` " /> + </set> + <set> + <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$defaultDomain"/> + <parameter name="replacement" value="default-domain"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$defaultProject"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$sdncNetworkPolicy"/> + <parameter name="replacement" value="`$tmp.ar-name`"/> + </execute> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id`'> + <outcome value=''> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-parentnetwork-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="parent-net" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$parent-net.networks.network_length`'> + <outcome value='1'> + <set> + <parameter name='ar-assignments.dest-network.network-id' value="`$parent-net.networks.network[0].network-id` " /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: Network id not found. Parent Service should only have one network" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No existing parent netorks" /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value='Other'> + <set> + <parameter name='ar-assignments.dest-network.network-id' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id` " /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-contrailappliedsvc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="vnf" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$vnf.vnfs.vnf_length`'> + <outcome value='1'> + <set> + <parameter name='ar-assignments.contrail-applied-service.vnf-id' value="`$vnf.vnfs.vnf[0].vnf-id` " /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: vnf id not found. Contrail applied service should only have one vnf" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No existing contrail applied service vnfs" /> + </return> + </block> + </outcome> + </execute> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`'> + <outcome value=''> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $ar-assignments.contrail-applied-service.vnf-id" + pfx='aai.vnf' local-only='false' > + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Vnf not found in AAI" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error retrieving vnf from AAI" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.vnf.vf-modules.vf-module_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="VF Module not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <for index='idx' start='0' end='`$aai.vnf.vf-modules.vf-module_length`' > + <switch test='`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <block> + <set> + <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn` " /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn` " /> + </set> + </outcome> + </switch> + <switch test='`$ar-assignments.contrail-applied-service.contrail-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No vf-module with contrail-service-instance-fqdn found in AAI" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " /> + </set> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' +value="`$ar-assignments.`" /> + </set> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value=''> + <set> + <parameter name='tmp.cidx' value="`0`" /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" /> + </set> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$cidx`' /> + <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' /> + <parameter name='tmp.found-cidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-cidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="description" value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`" /> + <parameter name="selflink" value="`$tmp.ar.self-link`" /> + <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" /> + <parameter name="model-version-id" value="`$ar-model.uuid`" /> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.network-ar-url`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{network-id}"/> + <parameter name="replacement" value="`$ar-assignments.dest-network.network-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="net-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml new file mode 100755 index 0000000..2f3c907 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml @@ -0,0 +1,380 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation-create' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' /> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="tenant" + key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND + cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND + tenant.tenant-id = $tmp.ar.tenant-id" + pfx='aai.tenant' local-only='false' > + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' /> + </set> + </block> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <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="GENERIC-RESOURCE-API.contrail-route-topology-operation-create"/> + <parameter name='field3' value='network-policy' /> + <parameter name='field4' value='create' /> + <parameter name='field5' value='contrailResp' /> + <parameter name='field6' value='default-domain' /> + <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' /> + <parameter name='field8' value='`$tmp.ar.tenant-name`' /> + <parameter name='field9' value='`$ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`' /> + <parameter name='field10' value='$aai.dest-network.contrail-network-fqdn' /> + <parameter name='field11' value='$aai.src-network.contrail-network-fqdn' /> + <parameter name='field12' value='<>' /> + <parameter name='field13' value='$tmp.ar.cloud-region-id' /> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='create' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' /> + <parameter name='default-project' value='`$tmp.ar.tenant-name`' /> + <!-- dummy for dev <parameter name='default-project' value='default-project' /> --> + <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> + <parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='direction' value='<>' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <switch test='`$contrailResp.resp-code`'> + <outcome value='0'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='policy-manager-create-policy' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create Policy in Policy Mgr. Rollback failed to delete policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create policy in PolicyMgr. '+ $error-message + 'Contrail network policy rolled back.'`" /> + </return> + </block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </call> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <!-- Create l3-network object --> + <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" /> + <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' value='`$ar-assignments.`' /> + </set> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml new file mode 100755 index 0000000..5fc21d2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml @@ -0,0 +1,309 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " /> + </set> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from source network" /> + </return> + </outcome> + </execute> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" /> + </return> + </outcome> + </execute> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + </delete> + <set> + <parameter name='ar-assignments.vlan-tag' value="" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml new file mode 100755 index 0000000..c57b5f9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml @@ -0,0 +1,258 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation-delete' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='PendingDelete'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to create policy in Contrail" /> + </return> + </outcome> + </execute> + <call module='GENERIC-RESOURCE-API' rpc='policy-manager-delete-policy' mode='sync' > + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </call> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </outcome> + </delete> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml new file mode 100755 index 0000000..e4cbfc2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml @@ -0,0 +1,338 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.parent-ar-url`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network`"/> + <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + <parameter name='tmp.dest-network-id' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.network-ar-url`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{network-id}"/> + <parameter name="replacement" value="`$tmp.dest-network-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="net-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + <parameter name='tmp.nidx' value='`$nidx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='true'> + <block atomic="true"> + <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <block atomic="true"> + <set> + <parameter name="tmp.newidx" value="`$snidx - 1`"/> + </set> + <set> + <parameter name="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.newidx]" value="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$snidx]" /> + </set> + </block> + </for> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length - 1`' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length == 0`'> + <outcome value='true'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + </execute> + <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <block atomic="true"> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $tmp.ar.allotted-resource-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name="tmp.sdidx" value="`$snidx`"/> + </set> + <break/> + </block> + </outcome> + </switch> + </block> + </for> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value='1'> + <block atomic="true"> + <set> + <parameter name="service-data.consumed-allotted-resources." value=""/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/> + </set> + <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <block atomic="true"> + <set> + <parameter name="tmp.newidx" value="`$snidx - 1`"/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." /> + </set> + </block> + </for> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/> + </set> + </block> + </outcome> + </switch> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml new file mode 100755 index 0000000..3b4b87e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml @@ -0,0 +1,56 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='contrail-route-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-contrail-route-input' mode='sync' ></call> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-assign' mode='sync' ></call> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-activate' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-unassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml new file mode 100755 index 0000000..c7e3454 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml @@ -0,0 +1,192 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='create-l3-subnet' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-idx' value='0' />
+ </set>
+ <switch test='`$v4.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v4.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v4.ip-prefix`" />
+ <parameter name="ipVersion" value="4" />
+ <parameter name="subnet" value="`$v4.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv4dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv4 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v4.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v4.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v4.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv4-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$v6.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="`$v6.entity-id`"/>
+ </record>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v6.ip-prefix`" />
+ <parameter name="ipVersion" value="6" />
+ <parameter name="subnet" value="`$v6.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv6dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv6 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v6.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v6.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v6.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv6-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml new file mode 100755 index 0000000..f9866fe --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml @@ -0,0 +1,437 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='create-route-target-and-vpn-binding' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rt.aic-zone`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource-value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-vpn-binding`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$rt.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$rt.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$rt.network-id`"/>
+ </execute>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.vpn-binding-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="vpn-binding.vpn-name" value="`$rt.network-name`" />
+ <parameter name="vpn-binding.asn" value="`$get-data-from-policy-output.asn`" />
+ <parameter name="vpn-binding.route-target-role" value="`$get-data-from-policy-output.route-target-role`" />
+ <parameter name="vpn-binding.aic-zone" value="`$rt.aic-zone`" />
+ <parameter name="vpn-binding.route-target-category" value="local" />
+ <parameter name="vpn-binding.resource" value="`$rt.resource`" />
+ <parameter name="vpn-binding.resource-value" value="`$rt.resource-value`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-vpn-binding-id' mode='sync' ></call>
+ <set>
+ <parameter name='vpn-binding.vpn-binding-id' value='`$tmp.return.generate-vpn-binding-id.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{vpn-binding-id}"/>
+ <parameter name="replacement" value="`$vpn-binding.vpn-binding-id`"/>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-binding.vpn-binding-id" >
+ <parameter name="vpn-id" value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name="vpn-name" value="`$vpn-binding.vpn-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.allocateRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$msRT.responseCode`'>
+ <outcome value='200'></outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Error: calling allocate resource microservice - responseCode: ' + $msRT.responseCode + ' responseMsg: ' + $msRT.responseMessage + ' allocateRouteTargetStatus: ' + $msRT.allocateRouteTargetStatus `"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: calling allocate resource microservice"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="vpn-binding.global-route-target" value="`$msRT.routeTargetID`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-target"
+ key="vpn-binding.vpn-binding-id = $vpn-binding.vpn-binding-id
+ AND route-target.global-route-target = $vpn-binding.global-route-target
+ AND route-target.route-target-role = $vpn-binding.route-target-role" >
+ <!-- Create route-target object -->
+ <parameter name="global-route-target" value="`$vpn-binding.global-route-target`" />
+ <parameter name="route-target-role" value="`$vpn-binding.route-target-role`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml new file mode 100644 index 0000000..411cbb3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml @@ -0,0 +1,482 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="dci-connects-network-topology-operation-activate" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <block atomic="true">
+ <block atomic="true">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_description'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.description" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_networkName'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.local_networks.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.local_networks.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.local_networks" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.local_networks_length`">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="l3-network" key="l3-network.network-name = $tmp.dci-connects.local_networks[$idx] AND depth = '0'" pfx="tmp.aai.l3-network" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.dci-connects.local_networks[$idx]" value="`$tmp.aai.l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_routerId'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.router_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_importRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_irts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_irts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_irts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_irts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_irts[$idx]" value="`$tmp.dci-connects.evpn_irts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_erts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_erts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_erts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_erts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_erts[$idx]" value="`$tmp.dci-connects.evpn_erts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_vni'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <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="dci-network-topology-operation-activate" />
+ <parameter name="field3" value="dci-connects.name" />
+ <parameter name="field4" value="`$prop.dci-connects.name`" />
+ <parameter name="field5" value="dci-connects.id" />
+ <parameter name="field6" value="`$prop.dci-connects.id`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l3-dci-connects'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l2-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l2-dci-connects'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_description'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.description" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ <outcome value="false">
+ <set>
+ <parameter name="prop.dci-connects.description" value="" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_networkName'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.local_networks.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.local_networks.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.local_networks" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.local_networks_length`">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="l3-network" key="l3-network.network-name = $tmp.dci-connects.local_networks[$idx] AND depth = '0'" pfx="tmp.aai.l3-network" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.dci-connects.local_networks[$idx]" value="`$tmp.aai.l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_routerId'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.router_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_importRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_irts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_irts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_irts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_irts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_irts[$idx]" value="`$tmp.dci-connects.evpn_irts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_exportRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_erts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_erts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_erts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_erts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_erts[$idx]" value="`$tmp.dci-connects.evpn_erts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_vni'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <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="dci-network-topology-operation-activate" />
+ <parameter name="field3" value="dci-connects.name" />
+ <parameter name="field4" value="`$prop.dci-connects.name`" />
+ <parameter name="field5" value="dci-connects.id" />
+ <parameter name="field6" value="`$prop.dci-connects.id`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l3-dci-connects'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l2-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l2-dci-connects'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.dci.network-id" />
+ </execute>
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="">
+ <set>
+ <parameter name="nidx" value="0" />
+ </set>
+ </outcome>
+ <outcome value="Other">
+ <set>
+ <parameter name="nidx" value="`$service-data.networks.network_length`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value="`$prop.dci.network-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`" />
+ <parameter name="service-data.networks.network_length" value="`$nidx+1`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status" value="Created" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action" value="`$network-topology-operation-input.sdnc-request-header.svc-action`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action" value="`$network-topology-operation-input.request-information.request-action`" />
+ </set>
+ <set>
+ <parameter name="networkId" value="`$prop.dci.network-id`" />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.dci.network-id + '/network-data/'` " />
+ </set>
+ </block>
+ </block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $prop.dci.network-id">
+ <parameter name="configuration-id" value="`$prop.dci.network-id`" />
+ <parameter name="configuration-type" value="overlay" />
+ <parameter name="configuration-sub-type" value="VPN-DCI" />
+ <parameter name="orchestration-status" value="Created" />
+ <parameter name="operational-status" value="Created" />
+ <parameter name="model-customization-id" value="`$prop.dci.network-id`" />
+ <parameter name="configuration-selflink" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.dci.network-id + '/network-data/'` " />
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" key="service-instance.service-instance-id = $service-data.service-information.service-instance-id AND customer.global-customer-id = $service-data.networks.network[$nidx].network-data.service-information.global-customer-id AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="configuration" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/configurations/configuration/' + $prop.dci.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="configuration.configuration-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.dci.network-id`" />
+ </save>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml new file mode 100644 index 0000000..d70691b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml @@ -0,0 +1,213 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="dci-connects-network-topology-operation-deactivate" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <block atomic="true">
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <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="dci-network-topology-operation-deactivate" />
+ <parameter name="field3" value="dci-connects.id" />
+ <parameter name="field4" value="`$prop.dci-connects.id`" />
+ <parameter name="field5" value="dci-connects.tunnelType" />
+ <parameter name="field6" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.dci-connects.id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l2-dci-connects/' + $prop.dci-connects.id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <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="dci-network-topology-operation-deactivate" />
+ <parameter name="field3" value="dci-connects.id" />
+ <parameter name="field4" value="`$prop.dci-connects.id`" />
+ <parameter name="field5" value="dci-connects.tunnelType" />
+ <parameter name="field6" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.dci-connects.id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l2-dci-connects/' + $prop.dci-connects.id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $network-topology-operation-input.network-information.network-id" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="1">
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <for silentFailure="true" index="snidx" start="`$tmp.nidx + 1`" end="`$service-data.networks.network_length`">
+ <block atomic="true" />
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value="" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` " />
+ </set>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml new file mode 100755 index 0000000..1e6c8bb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml @@ -0,0 +1,1127 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='eipam-allocate-generic-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.allocate-v4-subnet-flag" value="N" />
+ <parameter name="tmp.allocate-v6-subnet-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="tmp.leaf-level" value="N" />
+ </set>
+ <switch test="`$tmp.activate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.activate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.leaf-level" value="Y" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml new file mode 100755 index 0000000..8fd6376 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml @@ -0,0 +1,537 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='eipam-allocate-network-role-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="eipam-ip-block.ip-prefix" value='' />
+ <parameter name="eipam-ip-block.mask" value='' />
+ <parameter name="pfx.eipam-pool-row" value='' />
+ <parameter name="tmp.level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv4-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value='' />
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml new file mode 100755 index 0000000..1940615 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml @@ -0,0 +1,901 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='eipam-create-generic-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v4.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v4-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-name`"/>
+ <parameter name="field6" value="`$key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v6.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v6-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="parent_pool" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$level].key-name`"/>
+ <parameter name="field6" value="`$v6FQPN-output.pools[$level].key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml new file mode 100755 index 0000000..49436b4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml @@ -0,0 +1,699 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='eipam-create-network-role-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <parameter name="tmp.v4-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ <parameter name="tmp.v6-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <switch test="`$tmp.region`">
+ <outcome value="USA">
+ <set>
+ <parameter name="tmp.region" value="US" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v4-level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $tmp.v4-qip-pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v4-level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $tmp.level1-key-value ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v6-level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $tmp.v6-qip-pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v6-level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $tmp.level1-key-value ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml new file mode 100644 index 0000000..b9699d6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml @@ -0,0 +1,472 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generate-FQPN' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-FQPN-input.plan-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="generate-FQPN-input.plan-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.plan-name' value='`$generate-FQPN-input.plan-name`' />
+ </set>
+ <set>
+ <parameter name='generate-FQPN-output.' value='' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="getPlanTopology">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while getting Keyname and Keyvalue for address plan, '+ $eipam-ip-block.planName + ', from EIPAM'`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="eipam-ip-block.getPlanTopologyResponse.TopologyDetails is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-FQPN' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ADDRESS_PLAN_POLICIES table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ROUTING_CHARACTERISTIC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length > 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ADDRESS_PLAN_POLICIES table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ROUTING_CHARACTERISTIC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length > 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml new file mode 100644 index 0000000..b6792ad --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml @@ -0,0 +1,68 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc="generate-allottedresource-id" mode="sync"> + <block atomic="true"> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id." value="" /> + <parameter name="tmp.return.generate-allottedresource-id." value="" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" /> + <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.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $cto-api.service-type AND + service-instance.service-instance-id = $cto-api.port-mirror-configuration-instance-id AND + allotted-resource.id = $tmp.return.generate-allottedresource-id.id" + local-only="false" + pfx="tmp.local-variables.generate-allottedresource-id.ALLOTTEDRESOURCE" > + <outcome value='success'> + <block atomic='true'> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id.is-unique" value="0" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" /> + <outcome value='failure'> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-allottedresource-id" value="An error occured while generating a UUID for ALLOTTED-RESOURCE." /> + </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-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" /> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" /> + </return> + </outcome> + </get-resource> + </for> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id." value="" /> + </set> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml new file mode 100755 index 0000000..928e3a8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc="generate-host-routes-host-route-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ <parameter name="tmp.return.generate-host-routes-host-route-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.local.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-host-routes-host-route-id.HOST_ROUTE" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="An error occured while generating a UUID for HOST_ROUTE." />
+ </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-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml new file mode 100755 index 0000000..e44c148 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml @@ -0,0 +1,65 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc="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.onap.ccsdk.sli.core.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.core.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>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml new file mode 100755 index 0000000..b31a9ff --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml @@ -0,0 +1,136 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='generate-panorama-name' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.trust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_T' /> + <parameter name='tmp.untrust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_U' /> + </set> + <set> + <parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$original-name`" /> + <parameter name="regex" value="\."/> + <parameter name="limit" value="2" /> + <parameter name="ctx_memory_result_key" value="splits" /> + </execute> + <switch test='`$splits_length`'> + <outcome value='1'> + <set> + <parameter name='new-name' value='`$splits[0]`' /> + </set> + </outcome> + <outcome value='2'> + <set> + <parameter name='new-name' value='`$splits[1]`' /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unexpected network role used for panorama naming' /> + </return> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' > + <parameter name="source" value="`$new-name`" /> + <parameter name="outputPath" value="tmp.strlen"/> + </execute> + <switch test='`$tmp.strlen > 14`'> + <outcome value='true'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' > + <parameter name="string" value="`$new-name`" /> + <parameter name="result" value="new-name"/> + <parameter name="begin-index" value="0" /> + <parameter name="end-index" value="14" /> + </execute> + </block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='new-name' value='`$new-name`' /> + </set> + </block> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.trust-sz`"/> + <parameter name="outputPath" value="tmp.trust-sz"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$new-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.untrust-sz`"/> + <parameter name="outputPath" value="tmp.untrust-sz"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$new-name`"/> + </execute> + <set> + <parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$original-name`" /> + <parameter name="regex" value="\."/> + <parameter name="limit" value="2" /> + <parameter name="ctx_memory_result_key" value="splits" /> + </execute> + <switch test='`$splits_length`'> + <outcome value='1'> + <set> + <parameter name='new-name' value='`$splits[0]`' /> + </set> + </outcome> + <outcome value='2'> + <set> + <parameter name='new-name' value='`$splits[1]`' /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unexpected network role used for panorama naming' /> + </return> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' > + <parameter name="source" value="`$new-name`" /> + <parameter name="outputPath" value="tmp.strlen"/> + </execute> + <switch test='`$tmp.strlen > 14`'> + <outcome value='true'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' > + <parameter name="string" value="`$new-name`" /> + <parameter name="result" value="new-name"/> + <parameter name="begin-index" value="0" /> + <parameter name="end-index" value="14" /> + </execute> + </block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='new-name' value='`$new-name`' /> + </set> + </block> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.trust-sz`"/> + <parameter name="outputPath" value="tmp.trust-sz"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$new-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.untrust-sz`"/> + <parameter name="outputPath" value="tmp.untrust-sz"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$new-name`"/> + </execute> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml new file mode 100755 index 0000000..14ba7fe --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml @@ -0,0 +1,66 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc="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.onap.ccsdk.sli.core.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.core.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>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml new file mode 100755 index 0000000..7393842 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml @@ -0,0 +1,591 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generate-unique-name' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value='' />
+ <parameter name='generate-unique-name-output.generated-name' value='' />
+ </set>
+ <switch test='`$generate-unique-name-input.supplied-name`'>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $generate-unique-name-input.supplied-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the ' + $generate-unique-name-input.name-table-index + ' table'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
++ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name , null , null, $generate-unique-name-input.service-instance-id )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'The name ' + $generate-unique-name-input.supplied-name + ' has already been used'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-table-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-name not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-table-prefix-column`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-prefix-column not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.prefix`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100000' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100' />
+ </set>
+ </outcome>
+ <outcome value='3'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='1000' />
+ </set>
+ </outcome>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10000' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from ' + $generate-unique-name-input.index-table-name
++ ' WHERE ' + $generate-unique-name-input.index-table-prefix-column + ' = '
++ '$generate-unique-name-input.prefix'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.prefixdb'>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='true' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='`$tmp.gun.prefixdb.index-number + 1`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='false' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Error reading the ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.gun.found-flag' value='false' />
+ </set>
+ <block>
+ <for index='tmp.gun.idx' start='`$tmp.gun.index-number`' end='`$tmp.gun.list-end`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='4'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '000' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.index-string' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
++ ' set index_number = ' + $tmp.gun.index-string + ' where '
++ $generate-unique-name-input.index-table-prefix-column
++ ' = $generate-unique-name-input.prefix'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
++ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
++ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="naming exhausted for input with index-length = 0" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.gun.idx' start='1' end='`$tmp.gun.index-number`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.namedb.name' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="Error reading the GENERIC_RESOURCE_NAME table" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
++ ' set index_number = ' + $tmp.gun.index-string + ' where '
++ $generate-unique-name-input.index-table-prefix-column
++ ' = $generate-unique-name-input.prefix'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
++ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
++ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml new file mode 100755 index 0000000..1a981fa --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml @@ -0,0 +1,65 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc="generate-vpn-binding-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ <parameter name="tmp.return.generate-vpn-binding-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-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-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="n" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.return.generate-vpn-binding-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-vpn-binding-id.VPNBINDING" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </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-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml new file mode 100755 index 0000000..3ee1bbc --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml @@ -0,0 +1,108 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-notification-activate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Active' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='activate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml new file mode 100755 index 0000000..5db9776 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml @@ -0,0 +1,485 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-notification-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-provided-configuration' value='false' />
+ </set>
+ <set>
+ <parameter name='pc-index' value='0' />
+ </set>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-provided-configuration' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-provided-configuration`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-sub-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $generic-configuration-notification-input.service-information.service-instance-id
+ + '/service-data/provided-configurations/provided-configuration/'
+ + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='assigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <set>
+ <parameter name='cbr-index' value='0' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='assigned' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml new file mode 100755 index 0000000..88fcf35 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml @@ -0,0 +1,108 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-notification-deactivate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='PendingDelete' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='DeleteGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='deactivate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml new file mode 100755 index 0000000..a3c5fff --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml @@ -0,0 +1,353 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-notification-unassign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='pc2-index' start='`$pc-index + 1`' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$pc2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$prev-index].'
+ value='`$service-data.provided-configurations.provided-configuration[$pc2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='unassigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='unassigned' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml new file mode 100755 index 0000000..34bfcec --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml @@ -0,0 +1,39 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-notification' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generic-configuration-notification-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml new file mode 100755 index 0000000..56f0d74 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml @@ -0,0 +1,117 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='generic-configuration-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-generic-configuration-input' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <set>
+ <parameter name='gc.configuration-id'
+ value='`$generic-configuration-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$generic-configuration-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.request-information.'
+ value='`$generic-configuration-topology-operation-input.request-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.service-information.'
+ value='`$generic-configuration-topology-operation-input.service-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$generic-configuration-topology-operation-input.configuration-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.gc-request-input.'
+ value='`$generic-configuration-topology-operation-input.gc-request-input.`' />
+ </set>
+ <set>
+ <parameter name='gc.configuration-data.configuration-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-rpc-action'
+ value='assign' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$gc.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='notification-url'
+ value="`$prop.controller.url + '/restconf/operations/GENERIC-RESOURCE-API:generic-configuration-notification'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.bondingservice.server + $prop.bondingservice.uri`"/>
+ <parameter name="outputPath" value="tmp.bs-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.bondingservice.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.bs-url`' />
+ <parameter name='restapiUser' value='`$prop.bondingservice.user`' />
+ <parameter name='restapiPassword' value='`$prop.bondingservice.password`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="bonding-service-response" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.bondingservice.authorization`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Error calling bonding service; ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-genconfig.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="`$bonding-service-response.ackFinalIndicator`" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml new file mode 100755 index 0000000..07a0486 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml @@ -0,0 +1,181 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='get-complex-resource-service-model' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from COMPLEX_RESOURCE
+ WHERE customization_uuid = $get-complex-resource-service-model-input.customization-uuid'
+ pfx='db.complex-resource'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ATTRIBUTE_VALUE_PAIR
+ WHERE resource_uuid = $db.complex-resource.uuid
+ and resource_type = $db.complex-resource.type'
+ pfx='db.av-pair'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.av-pair_length`' >
+ <block atomic='true'>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_function' `">
+ <outcome value='true'>
+ <set>
+ <parameter name='get-complex-resource-service-model-output.cr-function' value='`$db.sdn-circuit-req[$idx].attribute-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-role" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_type'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-type" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_function'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-function" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_description'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-description" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'subinterface_network_quantity'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subinterface-network-quantity" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL
+ WHERE complex_resource_uuid = $db.complex-resource.uuid'
+ pfx='db.network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from RESOURCE_POLICY_TO_TARGET_NODE_MAPPING
+ WHERE target_node_uuid = $db.network-model.uuid
+ AND target_node_customization_uuid = db.network-model.customization-uuid'
+ pfx='db.respoltargetnodemap' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="SELECT * from RESOURCE_POLICY
+ WHERE policy_uuid = $db.respoltargetnodemap.policy_uuid
+ and policy_type = 'ecomp.policies.External' "
+ pfx='db.resource-policy'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.resource-policy_length`' >
+ <block atomic='true'>
+ <switch test="`$db.resource-policy[$idx].property-type == 'Name' and $db.resource-policy[$idx].property-name == 'Network Collection Name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-naming-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'subnetwork assignments' and $db.resource-policy[$idx].property-name == 'subnet'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subnet-assignment-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'network assignments' and $db.resource-policy[$idx].property-name == 'route target'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.vpn-binding-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml new file mode 100755 index 0000000..2c825d6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml @@ -0,0 +1,204 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='get-data-from-policy' mode='sync'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: get-data-from-policy: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <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="LAINA: get-data-from-policy: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='get-data-from-policy: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$get-data-from-policy-input.policy-instance-name`'>
+ <outcome value=''>
+ <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="LAINA: get-data-from-policy: input.policy-instance-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='get-data-from-policy: input.policy-instance-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$get-data-from-policy-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <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="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <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="LAINA: get-data-from-policy: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <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="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <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="LAINA: get-data-from-policy: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <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="LAINA: get-data-from-policy: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='get-data-from-policy: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: get-data-from-policy: jsonStringToCtx SUCCESS: policyName|policy-data|"/>
+ <parameter name='field3' value='`$jsonContextPrefix.policyName`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data`' />
+ </record>
+ <switch test='`$jsonContextPrefix.content.policy-data_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataIndex' start='0' end='`$jsonContextPrefix.content.policy-data_length`' >
+ <set>
+ <parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />
+ </set>
+ <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="LAINA: get-data-from-policy: policyDataIndex|nf-role|rule-1|rule-2:"/>
+ <parameter name='field3' value='`$policyDataIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].nf-role`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-1`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-2`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$jsonContextPrefix.content.policy-data.extended-params_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataExtendedParamsIndex' start='0' end='`$jsonContextPrefix.content.policy-data.extended-params_length`' >
+ <set>
+ <parameter name='output-param-name' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-name`' />
+ <parameter name='output-param-value' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-value`' />
+ </set>
+ <set>
+ <parameter name="`'get-data-from-policy-output.' + $output-param-name`" value="`$output-param-value`" />
+ </set>
+ <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="LAINA: get-data-from-policy: policyDataExtendedParamsIndex|output-param-name|output-param-value:"/>
+ <parameter name='field3' value='`$policyDataExtendedParamsIndex`' />
+ <parameter name='field4' value='`$output-param-name`' />
+ <parameter name='field5' value='`$output-param-value`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='get-data-from-policy-output.' value='`$jsonContextPrefix.content.policy-data.`' />
+ </set>
+ <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="LAINA: get-data-from-policy: get-data-from-policy-output.:"/>
+ <parameter name='field3' value='`$get-data-from-policy-output.`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <return status='success'></return>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml new file mode 100644 index 0000000..be34b3b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml @@ -0,0 +1,17 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='get-tunnelxconn-ar' mode='sync'>
+<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='tunnelxconn-allotted-resources' pfx='tmp.tunnel-ar.data' >
+</get-resource><for index='tunnelidx' start='0' end='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource_length`' >
+
+
+<block>
+<set>
+<parameter name='tmp.printout.consuming-service-instance-id' value='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+<parameter name='tmp.printout.index' value='`$tunnelidx`' />
+</set><switch test='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id == $tmp.ar.consuming-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.tunnelxconn-ar.' value='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].`' />
+</set></block></outcome></switch></block></for></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml new file mode 100644 index 0000000..a844fa5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml @@ -0,0 +1,31 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='get-vnf-api-parent-instance' mode='sync'>
+<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs' pfx='tmp.vnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.vnfdata.vnfs.vnf-list_length`' >
+
+
+<block>
+<set>
+<parameter name='tmp.debug.tmp.search.parent-service-instance-id' value='`$tmp.search.parent-service-instance-id`' />
+</set><switch test='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id == $tmp.search.parent-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.debug.service-instance.id1' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id`' />
+<parameter name='tmp.debug.service-instance.id2' value='`$tmp.search.parent-service-instance-id`' />
+<parameter name='tmp.debug.service-instance.id3.vnf-id' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+
+
+
+</set><set>
+<parameter name='tmp.old-service-data.vnf-id' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs/vnf-list/$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id/service-data/' pfx='parent-service-instance' >
+
+ <outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
+</return></outcome></get-resource><break></break></block></outcome></switch></block></for></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml new file mode 100755 index 0000000..0fb35de --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml @@ -0,0 +1,1912 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-composite-match-pair' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsc.log' />
+ </execute>
+ <for index='left-node-index' start='0' end='`$serv-cust_length - 1`' >
+ <block>
+ <set>
+ <parameter name='right-node-index' value='`$left-node-index + 1`' />
+ </set>
+ <for silentFailure='true' index='left-serv-index' start='0' end='`$serv-cust[$left-node-index].serv-insts_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length' value='0' />
+ </set>
+ <for silentFailure='true' index='right-serv-index' start='0' end='`$serv-cust[$right-node-index].serv-insts_length`' >
+ <block>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='0'>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`'>
+ <outcome value=''>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsd.log' />
+ </execute>
+ <set>
+ <parameter name='path-index' value='0' />
+ </set>
+ <for silentFailure='true' index='first-serv-index' start='0' end='`$serv-cust[0].serv-insts_length`' >
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='cur-vnf-seq' value='1' />
+ </set>
+ <set>
+ <parameter name='end-to-end-path' value='false' />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='`$tmp.service-path-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $tmp.service-path-instance-id`' />
+ </set>
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='cur-vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <for index='node-index' start='1' end='`$serv-cust_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='serv-index' start='0' end='`$serv-cust[$node-index].serv-insts_length`' >
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$max-vnf-seq + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='path-index' value='`$path-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path_length' value='`$path-index`' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml new file mode 100755 index 0000000..76b8df4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml @@ -0,0 +1,627 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-create-composite-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='serv-cust_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select sm.invariant_uuid
+ from SERVICE_PROXY sp, SERVICE_MODEL sm
+ where sp.source_service_uuid = sm.service_uuid
+ and sp.customization_uuid = $serv-cust[$serv-index].id'
+ pfx='db'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'Failure reading SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Cannot find entries in SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='serv-cust[$serv-index].inv-id' value='`$db.invariant-uuid`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <switch test='`$serv-cust[$serv-index].inv-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $serv-cust[$serv-index].inv-id`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Unable to find runtime service instances for invariant UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'System error finding runtime service instances for customization UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <switch test='`$output-global-customer-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <block>
+ <switch test='`$runtime-index`'>
+ <outcome value='0'>
+ <set>
+ <parameter name='service.service-role' value='`$aai.service-instances.results[0].service-instance.service-role`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Failure finding service instance ' + $si.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-inst.vnf-list_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT forwarding_path_service_instance_id from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING WHERE simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.mapped-service-instance-id'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="System error reading SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='data-error' value="`'No entry in SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$db.mapped-service-instance-id.forwarding-path-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="`'Cannot find service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' in MD-SAL'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='serv-inst.' value='' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts_length' value='`$tmp.serv-insts_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-composite-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsx.log' />
+ </execute>
+ <switch test='`$service-paths.service-path_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='false' />
+ </set>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-service-path`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='error-message' value="`'No service paths found for path name '
+ + $db.path-segment[0].path-name`" />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='Service' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.' value='`$service-paths.`' />
+ </set>
+ <switch test='`$output-service-instance-id`'>
+ <outcome value=''>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$output-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $output-service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $output-service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='service-index' start='0' end='`$service-paths.service-path[$sp-index].service_length`' >
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml new file mode 100755 index 0000000..71d3c77 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml @@ -0,0 +1,749 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-create-simple-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='vnf-ids_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No run-time service instances in AAI for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error calling AAI to get run-time service instances for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='runtime_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='runtime-ids[$runtime_length]' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='runtime_length' value='`$runtime_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$runtime_length`' >
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$runtime-ids[$runtime-index]`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='found-path' value='false' />
+ </set>
+ <for silentFailure='true' index='fp-index' start='0' end='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path[$fp-index].forwarding-path-name
+ == $db.path-segment[0].path-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-path`'>
+ <outcome value='false'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select forwarding_path_service_instance_id
+ from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ where simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.sitcim'>
+ <outcome value='not-found'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='error-message' value="`'Failure finding service instance ' + $serv-inst.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-simple-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.log' />
+ </execute>
+ <for index='serv-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml new file mode 100755 index 0000000..1ae609a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml @@ -0,0 +1,145 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-populate-from-grapi' mode='sync'>
+ <block>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <set>
+ <parameter name='vnf-ids-index' value='`$vnf-index`' />
+ </set>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='mismatch' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-ids-index' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-ids[$vnf-ids-index] == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.onap-model-information.model-customization-uuid`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-list_length == 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Unable to find VNF with customization UUID of ' + $vnf-ids[vnf-ids-index] + ' for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='mismatch' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$mismatch`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml new file mode 100755 index 0000000..e84e426 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml @@ -0,0 +1,569 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-populate-from-vnfapi' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="Could not read properties file" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$serv-inst.service-instance-id`'>
+ <outcome value=''>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input service-instance-id is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="serv-inst.service-instance-id is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$match-type`'>
+ <outcome value=''>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input match-type is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="input match-type is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name="path-type" value= "COMPOSITE"/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is blank, this is a COMPOSITE path"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="path-type" value= "SIMPLE"/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is NOT blank, this is a SIMPLE path"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="vnfListIndex" value= "0"/>
+ </set>
+ <switch test='`$path-type`'>
+ <outcome value='SIMPLE'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.triplet-list_length" value= "0" />
+ <parameter name="tmp.tripletListIndex" value= "0" />
+ <parameter name="tmp.vnf-instances_length" value= "0" />
+ <parameter name="tmp.vnfInstancesIndex" value= "0" />
+ <parameter name="tmp.mdsal-error-encountered" value= "false"/>
+ </set>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[' + $tmp.vnfInstancesIndex + ']'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ <parameter name="genericVnfIdFound" value= 'false' />
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.vnf-id`' />
+ <parameter name="field4" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`' />
+ </record>
+ <for index='tmp.tripletListIndex2' start='0' end='`$tmp.triplet-list_length`' >
+ <switch test='`$tmp.triplet-list[$tmp.tripletListIndex2].generic-vnf-id == $tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`'>
+ <outcome value='false'></outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name="genericVnfIdFound" value= 'true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$genericVnfIdFound`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].generic-vnf-id'`" value= '`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`' />
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].vf-module-id'`" value= '`$tmp.vf-module-ids[$vfModuleIndex]`' />
+ <parameter name="tmp.triplet-list_length" value= '`$tmp.triplet-list_length + 1`'/>
+ <parameter name="tmp.tripletListIndex" value= '`$tmp.tripletListIndex + 1`'/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id in NOT found in triplet-list, add it"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id is already in triplet-list, don't add it"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vnfInstancesIndex" value= '`$tmp.vnfInstancesIndex + 1`'/>
+ <parameter name="tmp.vnf-instances_length" value= '`$tmp.vnf-instances_length + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <switch test='`$tmp.mdsal-error-encountered`'>
+ <outcome value='false'>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <switch test='`$aai.generic-vnf.model-customization-id`'>
+ <outcome value=''>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: model-customization-id is BLANK for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Set model-customization-id for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field5" value='`$aai.generic-vnf.model-customization-id`'/>
+ </record>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].model-customization-id'`" value= '`$aai.generic-vnf.model-customization-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf not found in AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: unable to access AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: PRINT triplet-list | vf-module-id:generic-vnf-id:model-customization-id | "/>
+ <parameter name="field3" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field5" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ </for>
+ </block>
+ <for index='vnfIdIndex' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | tripletListIndex:model-customization-id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ <switch test='`$vnf-ids[$vnfIdIndex] == $tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='vnfInstanceIndex' start='0' end='`$tmp.vnf-instances_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | vnfInstanceIndex:id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$vnfInstanceIndex`'/>
+ <parameter name="field6" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id == $tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'>
+ <outcome value='true'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-instances.vnf-id and triplet-list.vf-module-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-id and vnf-instances for vnf-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field4" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for input vnf-id and triplet-list.model-customizaiton-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='COMPOSITE'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[0]'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: copy vnf-instance data to output: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.service-instance-id" value= "`$serv-inst.service-instance-id`"/>
+ <parameter name="serv-inst.vnf-list_length" value= "`$vnfListIndex`"/>
+ </set>
+ <switch test='`$serv-inst.vnf-list_length > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name="serv-inst.api" value= "VNF"/>
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/getpathsegment-populate-from-vnfapi-output.log' />
+ </execute>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml new file mode 100755 index 0000000..049f22e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml @@ -0,0 +1,125 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-simple-match-pair' mode='sync'>
+ <for index='serv-insts-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-insts-index].vnf-list_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='true' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length' value='0' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list_length - 1`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <set>
+ <parameter name='right-vnf-index' value='`$left-vnf-index + 1`' />
+ </set>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <for index='left-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name )
+ and
+ ( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-role )`'>
+ <outcome value='true'>
+ <switch test="`$serv-insts[$serv-insts-index].vnf-list[$vnf-index].vnf-network-list[$vnf-network-index].network-name == 'oam'`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-insts[$serv-insts-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-name'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-role'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length'
+ value='`$serv-insts[$serv-insts-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$found-match`">
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$found-match`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='false' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$matched-all-vnfs`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Not able to find matches for all vnfs of service instance ' + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments.' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml new file mode 100755 index 0000000..77d04d7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml @@ -0,0 +1,55 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-topology-operation-create' mode='sync'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from FORWARDING_PATH WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.forwarding-path[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading FORWARDING_PATH table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No paths found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='path-index' start='0' end='`$db.forwarding-path_length`' >
+ <switch test='`$db.forwarding-path[$path-index].path-type`'>
+ <outcome value='VF'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-simple-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Service Proxy'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-composite-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected path type ' + $db.forwarding-path[$path-index].path-type + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml new file mode 100755 index 0000000..e6c2c9d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml @@ -0,0 +1,36 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='getpathsegment-topology-operation' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-getpathsegment-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$getpathsegment-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$getpathsegment-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$getpathsegment-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$getpathsegment-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml new file mode 100644 index 0000000..f738418 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml @@ -0,0 +1,142 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='gw-vfmodule-update' mode='sync'>
+<block>
+<set>
+<!--
+<parameter name='tmp.brg-macaddress' value='fa:16:3e:8f:ea:68' />
+
+
+<parameter name='tmp.consuming-service-instance-id' value='b3cb7040-f7a5-4beb-ad2f-2a893b7d374b' />
+service-data.service-topology.service-topology-identifier.service-instance-id
+
+-->
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+<parameter name='tmp.consuming-service-instance-id' value='`$service-data.service-topology.service-topology-identifier.service-instance-id`' />
+</set><set>
+<parameter name='tmp.thisIsVGW' value='false' />
+</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API'
+ key='tunnelxconn-allotted-resources/' pfx='tmp.txconns' >
+ <outcome value='success'>
+<for index='txidx' start='0' end='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource_length`' >
+
+
+<block atomic='true'><set>
+<parameter name='tmp.test1' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+<!--
+this is null
+<parameter name='tmp.test2' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource-data[$txidx].tunnelxconn-topology[0].allotted-resource-identifiers[0].consuming-service-instance-id`' />
+--></set><switch test='`$tmp.test1 == $tmp.consuming-service-instance-id`'><outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.brg-macaddress'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address`' />
+
+</set><set>
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+<parameter name='tmp.consuming-service-instance-id' value='`$service-data.service-topology.service-topology-identifier.service-instance-id`' />
+
+<!--
+<parameter name='tmp.brg-macaddress' value='fa:16:3e:8f:ea:68' />
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+-->
+<!--
+<parameter name='tmp.consuming-service-instance-id' value='b3cb7040-f7a5-4beb-ad2f-2a893b7d374b' />
+service-data.service-topology.service-topology-identifier.service-instance-id
+
+-->
+</set><set>
+<parameter name='tmp.vg-vgmux-tunnel-vni'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni`' />
+<parameter name='tmp.vg-ip'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+</set><set>
+<parameter name='tmp.thisIsVGW' value='true' />
+</set></block></outcome></switch></block></for></outcome></get-resource><switch test='`$tmp.thisIsVGW`'>
+<outcome value='true'>
+<block>
+<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='preload-vnfs' pfx='tmp.preloadvnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list_length`' >
+
+
+<block atomic='true'><set>
+<parameter name='tmp.test3' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name`' />
+<parameter name='tmp.test4' value='`$tmp.brg-mac-address-match`'/>
+
+
+</set><switch test='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name == $tmp.brg-mac-address-match`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.endLoop1' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters_length`' /></set><for index='preloadIdx' start='0' end='`$tmp.endLoop1`'>
+<!--
+
+ "preload-data": {
+ "vnf-topology-information": {
+ "vnf-parameters": [
+
+ -->
+<block atomic='true'><set>
+<parameter name='tmp.vfmodule.param[$preloadIdx].name' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$preloadIdx].vnf-parameter-name`' />
+<parameter name='tmp.vfmodule.param[$preloadIdx].value' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$preloadIdx].vnf-parameter-value`' /></set></block></for><set>
+<parameter name='tmp.vfmodule.param_length' value='`$tmp.endLoop1`' />
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><set>
+<parameter name='tmp.restapi.service.vnf.vfmodule-resource' value='`$prop.restapi.service.vnf.vfmodule-resource`' />
+</set><set>
+<parameter name='tmp.vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-topology.service-topology-identifier.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ + '/'`"/>
+</set><set>
+<!--
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$input.vni`' />
+-->
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[0].allotted-resource-data[0].tunnelxconn-topology[0].tunnelxconn-assignments[0].vni`' />
+<parameter name='tmp.service.vnf.vf-module.vg-lan-ip' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[0].allotted-resource-data[0].tunnelxconn-topology[0].tunnelxconn-assignments[0].vg-ip`' />
+
+
+
+</set><set>
+<!--
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$input.vni`' />
+-->
+<parameter name='tmp.vg-mux-tunnel-vni-match' value='vg_vgmux_tunnel_vni' />
+<parameter name='tmp.vg-lan-ip-match' value='vgw_private_ip_0' />
+
+
+
+
+</set><for index='paramIdx' start='0' end='`$tmp.vfmodule.param_length`' >
+<block>
+<switch test='`$tmp.vfmodule.param[$paramIdx].name == $tmp.vg-mux-tunnel-vni-match`'><outcome value='true'>
+<set>
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.vg-vgmux-tunnel-vni`' />
+
+<!--
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni`' />
+--></set></outcome></switch><switch test='`$tmp.vfmodule.param[$paramIdx].name == $tmp.vg-lan-ip-match`'><outcome value='true'>
+<set>
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.vg-ip`' />
+<!--
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+--></set></outcome></switch></block></for><set>
+<!--
+<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param.'
+
+ service-data.vnfs.vnf\[0\]. vnf-data.vf-modules.vf-module\[0\] .vf-module-data.vf-module-topology.vf-module-parameters.param.
+ value='$tmp.vfmodule.' />
+-->
+<parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.'
+ value='$tmp.vfmodule.' /></set></block></outcome></switch></block></for></block></outcome><outcome value='Other'>
+<block>
+<return status='failure'>
+<parameter name='error-code' value='500' />
+<parameter name='error-message' value='Did not find vGW Preload' />
+</return></block></outcome></switch></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml new file mode 100644 index 0000000..724faf3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml @@ -0,0 +1,24 @@ +<!--Reserve/release IP-->
+<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='manage-ipaddr-assignment' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+ </set>
+ <switch test='`$tmp.manageIpaddr.action`'>
+ <outcome value='reserve'>
+ <block atomic='true'>
+ <get-resource plugin='`$tmp.sql.plugin`' resource='IPADDR' key="SELECT min(ipv4_addr) ip from IPV4_ADDRESS_POOL where universe = $tmp.manageIpaddr.pool and status='AVAILABLE'" pfx="tmp.manageIpaddr" >
+ <outcome value='success'>
+ <save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='RESERVED' where universe='VGW' and ipv4_addr = $tmp.manageIpaddr.ip" force='false'></save>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='release'>
+ <save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='AVAILABLE' where universe='VGW' and ipv4_addr = $tmp.manageIpaddr.ip" force='false'></save>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml new file mode 100644 index 0000000..169d20b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml @@ -0,0 +1,13 @@ +<!--Reserve/release VNI--><service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='manage-vni-assignment' mode='sync'>
+<block atomic='true'><set>
+<parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+</set><switch test='`$tmp.manageVni.action`'>
+<outcome value='reserve'>
+<block atomic='true'><get-resource plugin='`$tmp.sql.plugin`' resource='VNI' key="SELECT min(vlan_id) vni from VLAN_ID_POOL where purpose = $tmp.manageVni.pool and status='AVAILABLE'" pfx="tmp.manageVni" >
+<outcome value='success'>
+<save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='RESERVED' where purpose='VNI' and vlan_id = $tmp.manageVni.vni" force='false'>
+
+</save></outcome></get-resource></block></outcome><outcome value='release'>
+<save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='AVAILABLE' where purpose='VNI' and vlan_id=$tmp.manage-vni.vni" force='false'>
+
+</save></outcome></switch></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml new file mode 100755 index 0000000..2f6def6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml @@ -0,0 +1,1116 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='naming-policy-generate-name' mode='sync'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <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="LAINA: naming-policy-generate-name: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='naming-policy-generate-name: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$naming-policy-generate-name-input.naming-type`'>
+ <outcome value='VM'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VM_NAME_INDEX" />
+ <parameter name='table-type' value="VM_INSTANCE" />
+ <parameter name='table-prefix-column' value="vm_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='VNFC'>
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='505' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VNFC_NAME_INDEX" />
+ <parameter name='table-type' value="VNFC_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnfc_name_prefix" />
+ <parameter name='seq-length' value="0" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <set>
+ <parameter name='table-name' value="VNF_NAME_INDEX" />
+ <parameter name='table-type' value="VNF_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnf_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='NETWORK'>
+ <set>
+ <parameter name='table-name' value="NETWORK_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="NETWORK_INSTANCE" />
+ <parameter name='table-prefix-column' value="network_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='SERVICE'>
+ <set>
+ <parameter name='table-name' value="SERVICE_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="SERVICE_INSTANCE" />
+ <parameter name='table-prefix-column' value="service_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: invalid input.naming-type."/>
+ <parameter name="field3" value='`$naming-policy-generate-name-input.naming-type`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='503' />
+ <parameter name='error-message' value='naming-policy-generate-name: Invalid input.naming-type' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: input.policy-instance-name is not set but input.policy is not ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <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="LAINA: naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: input.vfc-customization-uuid is not set"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='ASSIGN | DELETE'></outcome>
+ </switch>
+ </block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='ASSIGN'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$naming-policy-generate-name-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <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="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <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="LAINA: naming-policy-generate-name: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='naming-policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <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="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-name' value="`$naming-policy-generate-name-input.generic-vnf-name`" />
+ <parameter name='constant-tag' value="`$naming-policy-generate-name-input.constant-tag`" />
+ <parameter name='sequence' value="`$naming-policy-generate-name-input.sequence`" />
+ </set>
+ <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="LAINA: naming-policy-generate-name: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$naming-policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="naming-policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <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="LAINA: naming-policy-generate-name: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: jsonStringToCtx SUCCESS: policy-instance-name|naming-models_length|constructed-name:"/>
+ <parameter name='field3' value='`$jsonContextPrefix.content.policy-instance-name`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models_length`' />
+ <parameter name='field5' value='`$constructed-name`' />
+ </record>
+ <for index='modelsIndex' start='0' end='`$jsonContextPrefix.content.naming-models_length`' >
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: modelsIndex|naming-type|naming-recipe:"/>
+ <parameter name='field3' value='`$modelsIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ </record>
+ <set>
+ <parameter name='naming-recipe' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ <parameter name='naming-type' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ </set>
+ <switch test='`$naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-type in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-recipe`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-recipe in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-type == $naming-policy-generate-name-input.naming-type`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='original-name' value='`$naming-recipe`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="namingRecipeSplits" />
+ </execute>
+ <for index='sectionIndex' start='0' end='`$namingRecipeSplits_length`' >
+ <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="LAINA: naming-policy-generate-name: Split naming-recipe sectionIndex|section value"/>
+ <parameter name="field3" value="`$sectionIndex`" />
+ <parameter name="field4" value="`$namingRecipeSplits[$sectionIndex]`" />
+ </record>
+ <block>
+ <set>
+ <parameter name='section-value' value="`$namingRecipeSplits[$sectionIndex]`" />
+ </set>
+ <for index='propertiesIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $section-value`'>
+ <outcome value='true'>
+ <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="LAINA: naming-policy-generate-name: recipe section match: section-value|property-name:"/>
+ <parameter name="field3" value="`$section-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <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="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="MD-SAL">
+ <block>
+ <switch test='`$property-name`'>
+ <outcome value="VMNAME">
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: required input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vm-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="VNFNAME">
+ <switch test='`$naming-policy-generate-name-input.vnf-name`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: required input.vnf-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vnf-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <!--<parameter name="source" value="`$naming-policy-generate-name-input.test-source-endpoint-path`" />-->
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system MD-SAL name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="TOSCA">
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <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="LAINA: naming-policy-generate-name: input.query-parameter is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.query-parameter is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' method='parameterizedQuery' emitsOutcome='true' >
+ <!--<parameter name='query' value='select nfc_naming_code from VFC_MODEL where customization_uuid = ?' />-->
+ <parameter name='query' value="`$source-endpoint`" />
+ <parameter name='prefix' value='queryPfx' />
+ <parameter name='param1' value="`$naming-policy-generate-name-input.query-parameter`" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='514' />
+ <parameter name='error-message' value='naming-policy-generate-name query-parameter not found in DB table'/>
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='515' />
+ <parameter name='error-message' value='naming-policy-generate-name database access failure'/>
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value=" "/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="sourceEndpointSplits" />
+ </execute>
+ <set>
+ <parameter name="query-parameter-name-underbars" value="`$sourceEndpointSplits[1]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$query-parameter-name-underbars`"/>
+ <parameter name="outputPath" value="tmp.query-parameter-name-dashes"/>
+ <parameter name="target" value="_"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <set>
+ <parameter name="full-query-param-name" value="`'queryPfx.' + $tmp.query-parameter-name-dashes`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$full-query-param-name`" />
+ <parameter name="outputPath" value="resolved-query-parameter" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $resolved-query-parameter`" />
+ <parameter name="new-part" value="`$resolved-query-parameter` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system TOSCA name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="AAI">
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointRegionKeySplits" />
+ </execute>
+ <set>
+ <parameter name="resource" value="`$aaiSourceEndpointRegionKeySplits[0]`" />
+ <parameter name="keys" value="`$aaiSourceEndpointRegionKeySplits[1]`" />
+ <parameter name='aai-constructed-name' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$keys`" />
+ <parameter name="regex" value="\:"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointKeySplits" />
+ </execute>
+ <for index='keyIndex' start='0' end='`$aaiSourceEndpointKeySplits_length`' >
+ <block>
+ <set>
+ <parameter name='key-value' value="`$aaiSourceEndpointKeySplits[$keyIndex]`" />
+ </set>
+ <for index='propIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $key-value`'>
+ <outcome value='true'>
+ <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="LAINA: naming-policy-generate-name: key match: key-value|property-name:"/>
+ <parameter name="field3" value="`$key-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <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="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="aai-new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="aai-new-part" value="`$property-value` " />
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$aai-constructed-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiQueryKeySplits" />
+ </execute>
+ <set>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[0]`" value= "`$aaiQueryKeySplits[0]`"/>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[1]`" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[2]`" value="`$aaiQueryKeySplits[2]`" />
+ <!--<parameter name="aaiQueryKeyPart1" value="cloud-region.cloud-owner = 'att-aic' AND " />-->
+ <parameter name="aaiQueryKeyPart1" value="`$aaiSourceEndpointKeySplits[0]`"/>
+ <parameter name="aaiQueryKeyPart2" value=" = '" />
+ <parameter name="aaiQueryKeyPart3" value="`$aaiQueryKeySplits[0]`" />
+ <parameter name="aaiQueryKeyPart4" value="' AND " />
+ <parameter name="aaiQueryKeyPart5" value="`$aaiSourceEndpointKeySplits[1]`"/>
+ <parameter name="aaiQueryKeyPart6" value=" = '" />
+ <parameter name="aaiQueryKeyPart7" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="aaiQueryKeyPart8" value="' AND " />
+ <parameter name="aaiQueryKeyPart9" value="`$aaiSourceEndpointKeySplits[2]`"/>
+ <parameter name="aaiQueryKeyPart10" value=" = '" />
+ <parameter name="aaiQueryKeyPart11" value="`$aaiQueryKeySplits[2]`" />
+ <parameter name="aaiQueryKeyPart12" value="'" />
+ <parameter name="aaiQueryKey" value="`$aaiQueryKeyPart1 + $aaiQueryKeyPart2 + $aaiQueryKeyPart3 + $aaiQueryKeyPart4 + $aaiQueryKeyPart5 + $aaiQueryKeyPart6 + $aaiQueryKeyPart7 + $aaiQueryKeyPart8 + $aaiQueryKeyPart9 + $aaiQueryKeyPart10 + $aaiQueryKeyPart11 + $aaiQueryKeyPart12 `" />
+ <!-- works without single quotes <parameter name="aaiQueryKey" value="`'cloud-region.cloud-owner = att-aic AND ' + $aaiSourceEndpointKeySplits[0] + ' = ' + $aaiQueryKeySplits[0] + ' AND ' + $aaiSourceEndpointKeySplits[1] + ' = ' + $aaiQueryKeySplits[1]`" />-->
+ <!-- key="cloud-region.cloud-owner = '$a' AND cloud-region.cloud-region-id = '$b' AND tenant.tenant-id = '$c' AND vserver.vserver-id = '$d'" -->
+ <!--<parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />-->
+ </set>
+ <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="LAINA: naming-policy-generate-name: Call AAI query for keys aai-constructed-name|region|aaiQueryKey:"/>
+ <parameter name="field3" value="`$aai-constructed-name`" />
+ <parameter name="field4" value="`$resource`" />
+ <parameter name="field5" value="`$aaiQueryKey`" />
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource='`$resource`'
+ key='`$aaiQueryKey`'
+ pfx="`'aai.' + $resource`" local-only='true' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $tmp.tenant-name`" />
+ <parameter name="new-part" value="`$tmp.tenant-name` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system AAI name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="seq-scope" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.scope`" />
+ <parameter name="seq-start-value" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.start-value` " />
+ <parameter name="seq-length" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.length` " />
+ <parameter name="seq-increment" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.increment` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: SDN-GC SEQUENCE info: scope|start-value|length|increment|constructed-name:"/>
+ <parameter name="field3" value="`$seq-scope`" />
+ <parameter name="field4" value="`$seq-start-value`" />
+ <parameter name="field5" value="`$seq-length`" />
+ <parameter name="field6" value="`$seq-increment`" />
+ <parameter name="field7" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="new-part" value="`$property-value` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: property-value name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <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="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: naming-type from returned policy does not match input.naming-type. Do not construct name for: "/>
+ <parameter name="field3" value="`$naming-type`" />
+ </record>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/naming-policy-generate-name.log' />
+ </execute>
+ <return status='success'>
+ <parameter name='naming-policy-generate-name-output.vm-name' value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value="`$naming-policy-generate-name-output.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <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="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml new file mode 100644 index 0000000..23aece7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml @@ -0,0 +1,182 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='naming-policy-generate-unique-name' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.action not supplied' />
+ </return>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="generate-unique-name-input.context-id cannot be null for ASSIGN action" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/generic-vnfs?vnf-name=' />
+ </set>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vservers?vserver-name=' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/l3-networks?network-name=' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/service-instances?service-instance-name=' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vnfcs?vnfc-name=' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.nononap' value='NON-ONAP' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.transient' value='TRANSIENT' />
+ </set>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='true' />
+ </set>
+ <while test='`$tmp.grn.loop.flag`'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in naming-policy-generate-unique-name: ' +
+ $generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value='`$generate-unique-name-output.generated-name`'/>
+ <parameter name="outputPath" value="encoded-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.nodes-query">
+ <parameter name="start[0]" value="`$tmp.gname.custom-query-string +
+ $encoded-name`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $tmp.gun.nononap
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </outcome>
+ </save>
+ </block>
+ </while>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $generate-unique-name-input.context-id
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND name = $generate-unique-name-output.generated-name
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <set>
+ <parameter name='rollback-generated-names-input.naming-type' value='`$generate-unique-name-input.name-table-type`' />
+ </set>
+ <set>
+ <parameter name='rollback-generated-names-input.context-id' value='`$generate-unique-name-input.context-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='rollback-generated-names' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in rollback-generated-names: ' +
+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='Invalid generate-unique-name-input.action. Valid values are ASSIGN or DELETE' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml new file mode 100755 index 0000000..ed5130a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml @@ -0,0 +1,206 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id AND
+ depth = 'all'"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <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>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].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="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - activate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="`$tmp.eipam-subnet-row.plan-name`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <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'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $aai.l3-network.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="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $networkId
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml new file mode 100755 index 0000000..4de5c5f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml @@ -0,0 +1,1405 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-assign-automated' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VPN_BINDINGS WHERE network_customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid'
+ pfx='vpn-bindings[]'>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='hasVpnBindings' value='true' />
+ </set>
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-bindings[$vidx].binding-uuid"
+ pfx='aai.vpnBinding' local-only='false' >
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Network model is_bound_to_vpn=true but no vpn_binding is present"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Unexpected error retrieving vpn binding"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value="`$tmp.return.generate-l3network-network-id.uuid`" />
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.complex-found' value='false' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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="Error retrieving cloud region from AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='service-data.network-request-input.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$aai.complex.region`'>
+ <outcome value='USA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='US' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CALA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='LA' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CA'>
+ <block></block>
+ </outcome>
+ <outcome value='US'>
+ <block></block>
+ </outcome>
+ <outcome value='LA'>
+ <block></block>
+ </outcome>
+ <outcome value='EMEA'>
+ <block></block>
+ </outcome>
+ <outcome value='AP'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex.region unknown"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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="Error retrieving complex from AA"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='Contrail'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for VIPR"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="EIPAM V6 Address plan should be null"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_DATA_PLANE_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PRIVATE_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid ipv6 address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid network-technology. Only AIC_SR_IOV and Contrail are supported for network automated flow"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.process-eipam-action' value='assign' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='process-eipam-pools' mode='sync' ></call>
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Values after process-eipam"/>
+ <parameter name="field5" value="`level1-v4-mask`"/>
+ <parameter name="field6" value="`$tmp.l3-network.level1.v4.mask`"/>
+ <parameter name="field7" value="`level1-v4-ipprefix`"/>
+ <parameter name="field8" value="`$tmp.l3-network.level1.v4.ip-prefix`"/>
+ <parameter name="field9" value="`level1-v4-entity-id`"/>
+ <parameter name="field10" value="`$tmp.l3-network.level1.v4.entity-id`"/>
+ <parameter name="field11" value="`level2-v4-mask`"/>
+ <parameter name="field12" value="`$tmp.l3-network.level2.v4.mask`"/>
+ <parameter name="field13" value="`level2-v4-ipprefix`"/>
+ <parameter name="field14" value="`$tmp.l3-network.level2.v4.ip-prefix`"/>
+ <parameter name="field15" value="`level2-v4-entity-id`"/>
+ <parameter name="field16" value="`$tmp.l3-network.level2.v4.entity-id`"/>
+ </record>
+ <set>
+ <parameter name='v4.entity-id' value='`$tmp.l3-network.level2.v4.entity-id`' />
+ <parameter name='v4.ip-prefix' value='`$tmp.l3-network.level2.v4.ip-prefix`' />
+ <parameter name='v4.mask' value='`$tmp.l3-network.level2.v4.mask`' />
+ <parameter name='v6.entity-id' value='`$tmp.l3-network.level2.v6.entity-id`' />
+ <parameter name='v6.ip-prefix' value='`$tmp.l3-network.level2.v6.ip-prefix`' />
+ <parameter name='v6.mask' value='`$tmp.l3-network.level2.v6.mask`' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='tmp.network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='tmp.network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ </set>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$hasVpnBindings`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.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="`$vpn-bindings[$vidx].binding-uuid`" />
+ <outcome value='failure'>
+ <block>
+ <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 network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </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 vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <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="`$service-data.service-information.global-customer-id`" />
+ <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="`$service-data.service-information.subscription-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="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block>
+ <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 network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </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 service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ 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="`$prop.cloud-region.cloud-owner`" />
+ <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-input.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-input.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="`$prop.cloud-region.cloud-owner`" />
+ <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-input.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 cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.l3-network.segmentation-id" value="1"/>
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="segmentation-assignment"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND segmentation-assignment.segmentation-id = $tmp.l3-network.segmentation-id" >
+ <!-- Create segmentation-assignment object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="segmentation-id" value="`$tmp.l3-network.segmentation-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 segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $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 segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value='$x.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml new file mode 100755 index 0000000..b0eb3f6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml @@ -0,0 +1,875 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-assign-from-preload' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$tmp.network-instance-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-name = $tmp.network-instance-name"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-name =' + $tmp.network-instance-name + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name="tmp.l3-network.physical-network-name" value="`$preload-data.preload-network-topology-information.physical-network-name`" />
+ <parameter name="tmp.l3-network.is-provider-network" value="`$preload-data.preload-network-topology-information.is-provider-network`" />
+ <parameter name="tmp.l3-network.is-shared-network" value="`$preload-data.preload-network-topology-information.is-shared-network`" />
+ <parameter name="tmp.l3-network.is-external-network" value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name="tmp.l3-network.tenant-id" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="tmp.l3-network.network-role-instance" value="0" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-type" value='`$tmp.l3-network.network-type`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto.log' />
+ </execute>
+ <switch test="`$preload-data.preload-network-topology-information.subnets_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.subnets_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-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>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].addr-from-start`">
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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>
+ </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.l3-network.network-id`" />
+ </set>
+ <call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" >
+ <!-- Create subnet object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="subnet-role" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-role`" />
+ <parameter name="gateway-address" value="`$tmp.gateway-address`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.host-routes_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ 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="`$prop.cloud-region.cloud-owner`" />
+ <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-input.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-input.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="`$prop.cloud-region.cloud-owner`" />
+ <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-input.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 cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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 cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vpn-binding-id != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.vpn-binding-id"
+ local-only="false"
+ pfx="tmp.AnAI.vpn-binding">
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.vpn-binding.vpn-id`" >
+ <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 vpn-binding-id = ' + $tmp.vpn-binding-id + '.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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 vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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 vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ 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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-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.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.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 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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-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.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.route-table-reference.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.preload-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 atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.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 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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <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="`$service-data.service-information.global-customer-id`" />
+ <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="`$service-data.service-information.subscription-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="`$service-data.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto2.log' />
+ </execute>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success' ></return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml new file mode 100755 index 0000000..56c9f6a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml @@ -0,0 +1,1097 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-assign-vlantagging-instancegroup' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.ngidx`">
+ <outcome value=''>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_len`'>
+ <outcome value=''>
+ <set>
+ <parameter name='ngidx' value='0' />
+ <parameter name='ngidx_len' value='1'/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ngidx' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length + 1`' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='ngidx' value='`$tmp.ngidx`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name="nig.preexists" value="false"/>
+ </set>
+ <switch test='`$ctx.network-instance-group-data.networks.network_len`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ <set>
+ <parameter name="nig.first-network" value="false" />
+ <parameter name="ngnidx" value="`$ctx.network-instance-group-data.networks.network_length`" />
+ <parameter name="nig.networks.network_len" value="`$ctx.network-instance-group-data.networks.network_length + 1`" />
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ <parameter name="tmp.l3-network.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ <parameter name='service-data.networks.network[$nidx].network-id' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx]..network-data.service-information.onap-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx]..network-data.network-information.onap-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-id =' + $tmp.l3-network.network-id + 'from AnAI. Network should be created by MSO'" />
+ </return>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ </get-resource>
+ <set>
+ <parameter name='aaiapi.input.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-network-instance-group' mode='sync' ></call>
+ <set>
+ <parameter name="get-complex-resource-service-model-input.customization-uuid" value="`$aaiapi.output.collection-customization-uuid`"/>
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-complex-resource-service-model' mode='sync' ></call>
+ <set>
+ <parameter name="nig.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`"/>
+ <parameter name="nig.network-instance-group-function" value="`$aaiapi.output.collection-function`"/>
+ <parameter name="nig.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <set>
+ <parameter name='nig.networks.network[$ngnidx].network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.subnet-assignment-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="nig.subnet-assignment-policy.subnet-use" value="`$get-data-from-policy-output.ip-assignment`" />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$get-complex-resource-service-model-output.network-naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ <parameter name='nig.network.network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="aaiapi.input.cloud-owner" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="aaiapi.input.cloud-region-id" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-aic-zone' mode='sync' ></call>
+ <set>
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$aaiapi.output.aic-clli`" />
+ </set>
+ <set>
+ <parameter name="nig.cloud-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.aic-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.resource" value="NetworkID" />
+ <parameter name="rt.resource-value" value="`$tmp.l3-network.network-id`" />
+ <parameter name="rt.network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="rt.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name="rt.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='create-route-target-and-vpn-binding' mode='sync' ></call>
+ <set>
+ <parameter name='nig.vpn-bindings.id' value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name='nig.vpn-bindings.global-route-target' value="`$vpn-binding.global-route-target`" />
+ <parameter name='nig.vpn-bindings.aic-zone' value="`$aaiapi.output.cloud-zone`" />
+ <parameter name='nig.vpn-bindings.route-target-role' value="`$vpn-binding.route-target-role`" />
+ </set>
+ <switch test='`$nig.subnet-assignment-policy.subnet-use`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Subnet use not set"/>
+ </set>
+ <switch test='`$tmp.nig-preexists`'>
+ <outcome value='true'>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-nig" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unique'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='shared'>
+ <block atomic="true">
+ <switch test='`$tmp.first-network`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </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 subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test='`$ngnidx`'>
+ <outcome value=''>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'></switch>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/aai/v$/network/instance-groups/instance-group/'+ $tmp.network-instance-group-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 instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </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 instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <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="`$service-data.service-information.global-customer-id`" />
+ <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="`$service-data.service-information.subscription-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="`$service-data.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>
+ </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>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.network-instance-groups.network-instance-group[$ngidx]." value='`$nig.`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml new file mode 100755 index 0000000..1f6f5d8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml @@ -0,0 +1,103 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tenant"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ tenant.tenant-id = $network-topology-operation-input.network-request-input.tenant"
+ pfx='aai.tenant' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-l3network-network-id' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.return.generate-l3network-network-id.uuid' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ <parameter name='network-topology-operation-input.network-information.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ </set>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$network-topology-operation-input.network-request-input.network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$network-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$network-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-instance-name' value='`$naming-policy-generate-name-output.network-name`' />
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-automated' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Network name is required if onap naming is false" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-instance-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ <parameter name='tmp.l3-network.network-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-from-preload' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-vlantagging-instancegroup' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml new file mode 100755 index 0000000..7d0155a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml @@ -0,0 +1,1172 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: changeassign only allowed for networks with from-preload set to true" />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$network-topology-operation-input.network-request-information.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id
+ AND depth='all'"
+ 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-data.network-topology.network-topology-identifier-structure.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-data.network-topology.network-topology-identifier-structure.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.preload-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.preload-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.preload-network-topology-information.subnets_length`">
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].network-start-address == $preload-data.preload-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.preload-network-topology-information.subnets[$n].cidr-mask`">
+ <outcome value='false'>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$n].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$n].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-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.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-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.preload-network-topology-information.subnets[$n].gateway-address`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-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="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].ip-assignment-direction == $tmp.addrFromStart.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-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.preload-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.preload-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.preload-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.AnAI.l3network.subnets.subnet[$k].subnet-role == $preload-data.preload-network-topology-information.subnets[$n].subnet-role`">
+ <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.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.subnets[$n].subnet-name`"/>
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$n].cidr-mask`"/>
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-start-address`"/>
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-end-address`"/>
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`"/>
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-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.preload-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.onap.ccsdk.sli.adaptors.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="PendingDelete" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-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 PendingDelete 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.preload-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 PendingDelete 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.preload-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.preload-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.preload-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>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gateway-address' value='`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`' />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-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.preload-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.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-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.preload-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>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$j].subnet-id`" />
+ </set>
+ <switch test='`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.subnets[$i].host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`">
+ <block atomic='true'>
+ <call module="VNF-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.local.subnet-id
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </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 host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target != ''`" >
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.global-route-target = $preload-data.preload-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.preload-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.preload-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.onap.ccsdk.sli.adaptors.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.preload-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.preload-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.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-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.preload-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.preload-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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-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.preload-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.preload-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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <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'>
+ <set>
+ <parameter name='ROLLBACK_START' value='NETWORK_TOPOLOGY_CHANGEASSIGN' />
+ </set>
+ <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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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.onap.ccsdk.sli.adaptors.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>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml new file mode 100644 index 0000000..b3e2b21 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml @@ -0,0 +1,565 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="network-topology-operation-create" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'serviceType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.service-type" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'topology'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.topology" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'technology'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.technology" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site1_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site2_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'sna1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.sna1_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'sna2_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.sna2_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'pe1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'pe2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_peer_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_peer_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_peer_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_peer_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_svlan'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_svlan" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_svlan'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_svlan" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_protocol'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_protocol" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_protocol'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_protocol" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_route'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_route" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$prop.l3vpn.ac1_route`" />
+ <parameter name="regex" value=" ## " />
+ <parameter name="ctx_memory_result_key" value="route1" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.l3vpn.sna1-route.ip-prefix" value="`$route1[0]`" />
+ <parameter name="prop.l3vpn.sna1-route.next-hop" value="`$route1[1]`" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_route'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_route" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$prop.l3vpn.ac2_route`" />
+ <parameter name="regex" value=" ## " />
+ <parameter name="ctx_memory_result_key" value="route2" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.l3vpn.sna2-route.ip-prefix" value="`$route2[0]`" />
+ <parameter name="prop.l3vpn.sna2-route.next-hop" value="`$route2[1]`" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_protocol_bgp_as'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_protocol_bgp_as" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ <parameter name="prop.l3vpn.peer1-ip" value="`$prop.l3vpn.ac1_ip`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_protocol_bgp_as'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_protocol_bgp_as" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ <parameter name="prop.l3vpn.peer2-ip" value="`$prop.l3vpn.ac2_ip`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'af_type'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.af_type" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $prop.l3vpn.pe1_id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.l3vpn.pe1_id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.l3vpn.pe1_id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vpn-policy1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.entry1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vrf1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vrf2-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.network-id" />
+ </execute>
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="">
+ <set>
+ <parameter name="nidx" value="0" />
+ </set>
+ </outcome>
+ <outcome value="Other">
+ <set>
+ <parameter name="nidx" value="`$service-data.networks.network_length`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.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-create" />
+ <parameter name="field3" value="L3VPN-Config" />
+ <parameter name="field4" value="`l3vpn.name`" />
+ <parameter name="field5" value="`$prop.l3vpn.name`" />
+ <parameter name="field6" value="`l3vpn.topology`" />
+ <parameter name="field7" value="`$prop.l3vpn.topology`" />
+ <parameter name="field8" value="`l3vpn.site1_name`" />
+ <parameter name="field9" value="`$prop.l3vpn.site1_name`" />
+ <parameter name="field10" value="`l3vpn.vpn-policy1-id`" />
+ <parameter name="field11" value="`$prop.l3vpn.vpn-policy1-id`" />
+ <parameter name="field12" value="`l3vpn.entry1-id`" />
+ <parameter name="field13" value="`$prop.l3vpn.entry1-id`" />
+ <parameter name="field14" value="`l3vpn.sna1_name`" />
+ <parameter name="field15" value="`$prop.l3vpn.sna1_name`" />
+ <parameter name="field16" value="`l3vpn.pe1_id`" />
+ <parameter name="field17" value="`$prop.l3vpn.pe1_id`" />
+ <parameter name="field18" value="`l3vpn.ac1_id`" />
+ <parameter name="field19" value="`$prop.l3vpn.ac1_id`" />
+ <parameter name="field20" value="`l3vpn.ac1_svlan`" />
+ <parameter name="field21" value="`$prop.l3vpn.ac1_svlan`" />
+ <parameter name="field22" value="`l3vpn.ac1_peer_ip`" />
+ <parameter name="field23" value="`$prop.l3vpn.ac1_peer_ip`" />
+ <parameter name="field24" value="`l3vpn.ac1_ip`" />
+ <parameter name="field25" value="`$prop.l3vpn.ac1_ip`" />
+ <parameter name="field26" value="`l3vpn.ac1_protocol`" />
+ <parameter name="field27" value="`$prop.l3vpn.ac1_protocol`" />
+ <parameter name="field28" value="`l3vpn.sna1-route-ip-prefix`" />
+ <parameter name="field29" value="`$prop.l3vpn.sna1-route-ip-prefix`" />
+ <parameter name="field30" value="`l3vpn.sna1-route-next-hop`" />
+ <parameter name="field31" value="`$prop.l3vpn.sna1-route-next-hop`" />
+ <parameter name="field32" value="`l3vpn.peer1_ip`" />
+ <parameter name="field33" value="`$prop.l3vpn.peer1_ip`" />
+ <parameter name="field34" value="`l3vpn.ac1_protocol_bgp_as`" />
+ <parameter name="field35" value="`$prop.l3vpn.ac1_protocol_bgp_as`" />
+ <parameter name="field36" value="`l3vpn.vrf1-id`" />
+ <parameter name="field37" value="`$prop.l3vpn.vrf1-id`" />
+ <parameter name="field38" value="`l3vpn.site2_name`" />
+ <parameter name="field39" value="`$prop.l3vpn.site2_name`" />
+ <parameter name="field40" value="`l3vpn.vpn-policy2-id`" />
+ <parameter name="field41" value="`$prop.l3vpn.vpn-policy2-id`" />
+ <parameter name="field42" value="`l3vpn.entry2-id`" />
+ <parameter name="field43" value="`$prop.l3vpn.entry2-id`" />
+ <parameter name="field44" value="`l3vpn.sna2_name`" />
+ <parameter name="field45" value="`$prop.l3vpn.sna2_name`" />
+ <parameter name="field46" value="`l3vpn.pe2_id`" />
+ <parameter name="field47" value="`$prop.l3vpn.pe2_id`" />
+ <parameter name="field48" value="`l3vpn.ac2_id`" />
+ <parameter name="field49" value="`$prop.l3vpn.ac2_id`" />
+ <parameter name="field50" value="`l3vpn.ac2_svlan`" />
+ <parameter name="field51" value="`$prop.l3vpn.ac2_svlan`" />
+ <parameter name="field52" value="`l3vpn.ac2_peer_ip`" />
+ <parameter name="field53" value="`$prop.l3vpn.ac2_peer_ip`" />
+ <parameter name="field54" value="`l3vpn.ac2_ip`" />
+ <parameter name="field55" value="`$prop.l3vpn.ac2_ip`" />
+ <parameter name="field56" value="`l3vpn.ac2_protocol`" />
+ <parameter name="field57" value="`$prop.l3vpn.ac2_protocol`" />
+ <parameter name="field58" value="`l3vpn.sna2-route-ip-prefix`" />
+ <parameter name="field59" value="`$prop.l3vpn.sna2-route-ip-prefix`" />
+ <parameter name="field60" value="`l3vpn.sna2-route-next-hop`" />
+ <parameter name="field61" value="`$prop.l3vpn.sna2-route-next-hop`" />
+ <parameter name="field62" value="`l3vpn.peer2_ip`" />
+ <parameter name="field63" value="`$prop.l3vpn.peer2_ip`" />
+ <parameter name="field64" value="`l3vpn.ac2_protocol_bgp_as`" />
+ <parameter name="field65" value="`$prop.l3vpn.ac2_protocol_bgp_as`" />
+ <parameter name="field66" value="`l3vpn.vrf2-id`" />
+ <parameter name="field67" value="`$prop.l3vpn.vrf2-id`" />
+ <parameter name="field68" value="`l3vpn.af_type`" />
+ <parameter name="field69" value="`$prop.l3vpn.af_type`" />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <switch test="`$prop.l3vpn.service-type`">
+ <outcome value="l3vpn-ipwan">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="token-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.token_id" value="`$token-result.data.token_id`" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/l3smvpntemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="vpn-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3smvrftemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="put" />
+ <parameter name="responsePrefix" value="vrf-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vrf rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3smsitetemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="site-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create site rest api" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value="l3vpn-sptn">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/sptn-l3vpn-template.xml'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/sptn-service-l3vpn:service/snc-l3vpns'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="xml" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unexpected error retrieving vpn binding" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`" />
+ <parameter name="service-data.networks.network_length" value="`$nidx+1`" />
+ </set>
+ <set>
+ <parameter name="pidx" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].name" value="vrf1_id" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].value" value="`$prop.l3vpn.vrf1-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx+1].name" value="vrf2_id" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx+1].value" value="`$prop.l3vpn.vrf2-id`d" />
+ <parameter name="service-data.networks.network[$nidx].network_data.network-request-input.network-input-parameters.param_length" value="`$pidx+2`" />
+ </set>
+ <set>
+ <parameter name="networkId" value="`$prop.l3vpn.network-id`" />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.l3vpn.network-id + '/network-data/'` " />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status" value="Created" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action" value="`$network-topology-operation-input.sdnc-request-header.svc-action`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action" value="`$network-topology-operation-input.request-information.request-action`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $prop.l3vpn.network-id">
+ <parameter name="configuration-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="configuration-type" value="underlay" />
+ <parameter name="configuration-sub-type" value="l3vpn" />
+ <parameter name="orchestration-status" value="Created" />
+ <parameter name="operational-status" value="Created" />
+ <parameter name="model-customization-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="configuration-selflink" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.l3vpn.network-id + '/network-data/'` " />
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" key="service-instance.service-instance-id = $service-data.service-information.service-instance-id AND customer.global-customer-id = $service-data.networks.network[$nidx].network-data.service-information.global-customer-id AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="configuration" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/configurations/configuration/' + $prop.l3vpn.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="configuration.configuration-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.l3vpn.network-id`" />
+ </save>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml new file mode 100644 index 0000000..54c8a75 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml @@ -0,0 +1,172 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id
+ AND depth='all'"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <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>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].subnet-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - deactivate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="$tmp.eipam-subnet-row.plan-name"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $aai.l3-network.network-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $networkId
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml new file mode 100644 index 0000000..0624045 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="network-topology-operation-delete" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="0">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <for index="nidx" start="0" end="`$service-data.networks.network_length`">
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value="true">
+ <set>
+ <parameter name="tmp.nidx" value="`$nidx`" />
+ <parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.name" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'serviceType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.service-type" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'pe1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe1_id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site1_name" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'vrf1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.vrf1-id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'vrf2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.vrf2-id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $prop.l3vpn.pe1_id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].serviceUrl`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Network model is_bound_to_vpn=true but no vpn_binding is present" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unexpected error retrieving vpn binding" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
+ <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties" />
+ <parameter name="contextPrefix" value="prop" />
+ </execute>
+ <switch test="`$prop.l3vpn.service-type`">
+ <outcome value="l3vpn-ipwan">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="token-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.token_id" value="$token-result.data.token_id" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites/site=' + $prop.l3vpn.site1_name`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="site-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete Site rest api" />
+ </return>
+ </outcome>
+ <outcome value="success">
+ <block />
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes/vrf-attribute=' + $prop.l3vpn.vrf1-id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="vrf1-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VRF1 rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes/vrf-attribute=' + $prop.l3vpn.vrf2-id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="vrf2-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VRF2 rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services/vpnservice=' + $prop.l3vpn.name`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="delete" />
+ <parameter name="responsePrefix" value="vpn-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks" />
+ <parameter name="trustStorePassword" value="adminadmin" />
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12" />
+ <parameter name="keyStorePassword" value="adminadmin" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VPN rest api" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $network-topology-operation-input.network-information.network-id" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="1">
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <for silentFailure="true" index="snidx" start="`$tmp.nidx + 1`" end="`$service-data.networks.network_length`">
+ <block atomic="true" />
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value="" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` " />
+ </set>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml new file mode 100755 index 0000000..0ae9fa7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml @@ -0,0 +1,443 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='network-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='success'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <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>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $service-data.networks.network[$nidx].network-data.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.networks.network[$nidx].network-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'></get-resource>
+ <set>
+ <parameter name="tmp.level1-key-value" value=""/>
+ <parameter name="tmp.level1inuse" value="false" />
+ <parameter name="pidx" value="0" />
+ <parameter name="pidx-len" value="0" />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.network_id = $network-topology-operation-input.network-information.network-id and s.entity_id = k.entity_id ; "
+ pfx='tmp.eipam-subnet-row[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='esidx' start='0' end='`$tmp.eipam-subnet-row_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.eipam-subnet-row[$esidx].level`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].key-value`"/>
+ </set>
+ <set>
+ <parameter name="tmp.plan-name[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].plan-name`"/>
+ </set>
+ <set>
+ <parameter name="pidx" value="`$pidx + 1`"/>
+ </set>
+ <set>
+ <parameter name="pidx-len" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name="eipam-ip-block.entity-id" value='' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateAllSubnets">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnets in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting level 2 plans in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='npidx' start='0' end='`$pidx-len`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value" value="`$tmp.level1-key-value[$npidx]`" />
+ <parameter name="tmp.plan-name" value="`$tmp.plan-name[$npidx]`" />
+ </set>
+ <switch test='`$tmp.level1-key-value`'>
+ <outcome value=''>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test='`$network-model`'>
+ <outcome value=''></outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level2pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level1pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level2pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level1pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml new file mode 100644 index 0000000..51d6b6a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml @@ -0,0 +1,571 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='network-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-network-input' mode='sync' ></call> + <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='PendingDelete'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='PendingCreate'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='Other'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign' mode='sync' ></call> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ActivateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='ActivateDCINetworkInstance'> + <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='ActivateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='PendingCreate'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value='changeassign'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-changeassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeactivateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='DeActivateDCINetworkInstance'> + <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='DeactivateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='PendingCreate'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> + </outcome> + <outcome value='PendingDelete'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for unassign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='update'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ChangeInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-change-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-change-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='create'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='CreateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + <outcome value='CreateInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-create-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-create-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + <outcome value='CreateAccessConnectivityInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-create-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-create-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='delete'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-delete' mode='sync' ></call> + </outcome> + <outcome value='DeleteSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-delete' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + <outcome value='DeleteAccessConnectivityInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-delete-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-delete-nokia' mode='sync' ></call> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + <outcome value='DeleteInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-delete-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-delete-nokia' mode='sync' ></call> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='reoptimize'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ReoptimizeSOTNInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-reoptimize' mode='sync' ></call> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml new file mode 100644 index 0000000..a382b02 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml @@ -0,0 +1,84 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='pnf-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreatePnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'activate' then request-action must be 'CreatePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no PNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find PNF ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating pnf in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No pnf found in AAI with pnf-id = ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml new file mode 100644 index 0000000..f25087e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml @@ -0,0 +1,71 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='pnf-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$pnf-topology-operation-input.pnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreatePnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreatePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VF customization UUID ' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for pnf with pnf-id=' + $pnf-topology-operation-input.pnf-details.pnf-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-assign.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml new file mode 100644 index 0000000..5cb8438 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml @@ -0,0 +1,84 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='pnf-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeletePnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeletePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no PNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find PNF with pnf-id = ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating pnf in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No pnf found in AAI with pnf-id = ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml new file mode 100644 index 0000000..48bffb4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml @@ -0,0 +1,93 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='pnf-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeletePnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'unassign' then request-action must be 'DeletePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`' >
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-unassign' mode='sync' >
+ <outcome value='success'>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.pnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$pnf-index + 1`' end='`$service-data.pnfs.pnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$tmpidx]." value="$service-data.pnfs.pnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$service-data.pnfs.pnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf_length" value="`$service-data.pnfs.pnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve pnf resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml new file mode 100644 index 0000000..8ab8729 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml @@ -0,0 +1,38 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='pnf-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-pnf-input' mode='sync' ></call>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$pnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml new file mode 100755 index 0000000..c6d45de --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml @@ -0,0 +1,46 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='policy-manager-create-policy' mode='sync'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to push policy in Policy Manager' /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to create policy in Policy Manager' /> + </return> + </outcome> + </execute> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml new file mode 100755 index 0000000..e5bcb09 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml @@ -0,0 +1,46 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='policy-manager-delete-policy' mode='sync'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypdp.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypap.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to delete policy from Policy Manager (PAP)' /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to delete policy from Policy Manager (PDP)' /> + </return> + </outcome> + </execute> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml new file mode 100755 index 0000000..a0d77fd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml @@ -0,0 +1,89 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='policy-update-notify-operation' mode='sync'> + <block atomic="true"> + <switch test='`$policy-update-notify-operation-input.update-type`'> + <outcome value='Update'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <set> + <parameter name='tmp.sql' value="`'insert into POLICY_UPDATE_NOTIFICATION (policy_name,version_id,update_type) values ( ' ++ ' $policy-update-notify-operation-input.policy-name , $policy-update-notify-operation-input.version-id , $policy-update-notify-operation-input.update-type )'`" /> + </set> + <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key="`$tmp.sql`" pfx='pfx'></save> + <set> + <parameter name='tmp.policy-name' value='`$policy-update-notify-operation-input.policy-name`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='POST' /> + <parameter name='responsePrefix' value="policy" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to get policy from Policy Manager' /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' > + <parameter name='source' value="policy.config" /> + <parameter name='outputPath' value="tmp.config-ctx" /> + <parameter name='isEscaped' value='false' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to convert config variable from PolicyManager' /> + </return> + </outcome> + </execute> + <set> + <parameter name='policy-name' value='`$tmp.config-ctx.content.fq_name[2]`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$policy-name`" /> + <parameter name="regex" value="_"/> + <parameter name="limit" value="3" /> + <parameter name="ctx_memory_result_key" value="policy-splits" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='update' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$policy-splits[1]`' /> + <parameter name='update-network-policy-json' value='`$policy.config`' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Error updating Contrail: ' + $contrailResp.resp-message`" /> + </return> + </outcome> + </execute> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="success" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml new file mode 100644 index 0000000..a5e7438 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml @@ -0,0 +1,113 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-get-policy' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.policy-name' value='`$db.cap[0].policy-name`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='POST' /> + <parameter name='responsePrefix' value="policy" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to get policy from Policy Manager' /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' > + <parameter name='source' value="policy.config" /> + <parameter name='outputPath' value="tmp.config-ctx" /> + <parameter name='isEscaped' value='false' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to convert config variable from PolicyManager' /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="toLower"> + <parameter name="source" value="`$tmp.tenant-context`" /> + <parameter name="outputPath" value="tmp.lc-tenant-context" /> + </execute> + <switch test='`$tmp.lc-tenant-context`'> + <outcome value=''> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="prod" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.productionContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="test" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.testContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="dev" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.developmentContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="default" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unexpected tenant-context value of ' + $tmp.tenant-context`" /> + </return> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </switch> + <switch test='`$tmp.dest-p-interface`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find p-interface in policy ' + tmp.policy-name`" /> + </return> + </outcome> + </switch> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml new file mode 100644 index 0000000..7b1ab18 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml @@ -0,0 +1,52 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-rollback-capacity-db' mode='sync'> + <block> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity + from VNICS_CAPACITY + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id + and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name' + pfx='db.vnics-capacity'> + <outcome value='success'> + <block> + <set> + <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" +key="update VNICS_CAPACITY + set available_capacity = $tmp.avail-capacity + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id + and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name +" ></update> + </block> + </outcome> + </get-resource> + </block> + </for> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CONFIGURATION_ID + where configuration_id = $tmp.configuration-id + and vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select configuration_id + from VNICS_CONFIGURATION_ID + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' + pfx='db.vnics-confid'> + <outcome value='not-found'> + <block> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CAPACITY + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CAPACITY_GROUP + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + </block> + </outcome> + </get-resource> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml new file mode 100644 index 0000000..0d95f40 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml @@ -0,0 +1,765 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-activate-async' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.' + value='`$port-mirror-topology-operation-input.sdnc-request-header.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.src-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' /> + <parameter name='cto-api.collector-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-activate' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </outcome> + </call> + </block> + </outcome> + </switch> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + </outcome> + <outcome value='pprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='vni' value='1000' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='juniper-header' value='false' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="true" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='success'> + <set> + <parameter name='l-interface-set[$src-idx]' value='true' /> + </set> + </outcome> + </update> + </block> + </for> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="in-service-path" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Unable to find configuration object in AAI" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failure updating configuration object in AAI" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </update> + <set> + <parameter name='pm.configuration-data.configuration-oper-status.order-status' + value='Active' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-action' + value='`$port-mirror-topology-operation-input.request-information.request-action`' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action' + value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </execute> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="200" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='success'> + <parameter name='error-code' value='200' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml new file mode 100644 index 0000000..d95950e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml @@ -0,0 +1,57 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-activate-sync' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.pm.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" /> + </return> + </outcome> + </switch> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='N' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml new file mode 100755 index 0000000..edb5557 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml @@ -0,0 +1,2253 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='port-mirror-topology-operation-assign-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='tmp.src-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-pnf-name' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`' />
+ <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='tmp.configuration-sub-type' value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.request-information.'
+ value='`$port-mirror-topology-operation-input.request-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.service-information.'
+ value='`$port-mirror-topology-operation-input.service-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$port-mirror-topology-operation-input.configuration-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.port-mirror-configuration-request-input.'
+ value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity,network_role,policy_name
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='cap-idx' start='0' end='`$db.cap_length`' >
+ <switch test='`$db.cap[$cap-idx].role`'>
+ <outcome value='source'>
+ <set>
+ <parameter name='tmp.src-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.src-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.src-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ <outcome value='collector'>
+ <set>
+ <parameter name='tmp.dest-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.dest-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.dest-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.src-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-src-nfc-naming-code" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.dest-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-dest-nfc-naming-code" />
+ </execute>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`'>
+ <outcome value=''>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ <parameter name='tmp.dest-vnfc-idx' value='1' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vnfc-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.src-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.src-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Source nfc-naming-code of ' + $tmp.src-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.dest-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.dest-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Dest nfc-naming-code of ' + $tmp.dest-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='tmp.dest-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 2`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`'/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $tmp.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No owning entity returned from AAI: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.owning-entity' value='`$tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id`' />
+ </set>
+ </outcome>
+ </save>
+ <switch test='`$tmp.owning-entity`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve owning-entity from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-context' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-owner' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant-id from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-region-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-owner`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.dest-vnf.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant-id' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.dest-tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant-id from AAI" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner'
+ value='`$tmp.cloud-owner`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id'
+ value='`$tmp.cloud-region-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant'
+ value='`$tmp.tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id'
+ value='`$tmp.tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant'
+ value='`$tmp.dest-tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant-id'
+ value='`$tmp.dest-tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-context'
+ value='`$tmp.tenant-context`' />
+ </set>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-get-policy' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.src-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.dest-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-src-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-dest-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].instance-group-role'
+ value='`$tmp.dest-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].group-type'
+ value='port-mirror-dest'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.dest-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnf-id'
+ value='`$tmp.dest-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-name'
+ value='`$tmp.dest-pnf-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-p-interface'
+ value='`$tmp.dest-p-interface`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-port-policy-name'
+ value='`$db.cap[0].policy-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='pprobe' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-nw-idx' start='0' end='`$tmp.AnAI-data.src-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.src-network-name' value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn'
+ value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.src-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine source network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <for index='dest-nw-idx' start='0' end='`$tmp.AnAI-data.dest-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.dest-network-name' value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn'
+ value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.dest-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine dest network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-create-vnfcs' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-vprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='pprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-pprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.parent-service-instance-id' value='`$tmp.service-instance-id`' />
+ <parameter name='cto-api.port-mirror-configuration-instance-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.source-network-role' value='`$tmp.src-network-role`' />
+ <parameter name='cto-api.collector-network-role' value='`$tmp.dest-network-role`' />
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.cloud-owner' value='`$tmp.cloud-owner`' />
+ <parameter name='cto-api.service-type' value='`$port-mirror-topology-operation-input.service-information.subscription-service-type`' />
+ <parameter name='cto-api.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-create' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id'
+ value='`$cto-api.contrail-route-allotted-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.configuration-name' value="`'PMC_' + $tmp.tenant + '_' + $tmp.cloud-region-id + '_' + $port-mirror-topology-operation-input.configuration-information.configuration-type + '_' + $tmp.configuration-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.configuration-name' value='`$port-mirror-topology-operation-input.configuration-information.configuration-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.link-name`" />
+ <parameter name="outputPath" value="tmp.encoded-link-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" >
+ <parameter name="link-name" value="`$tmp.link-name`" />
+ <parameter name="in-maint" value="false" />
+ <parameter name="link-type" value="port-mirror-configuration" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.dest-tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.dest-p-interface`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-p-interface" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/pnfs/pnf/'
+ + $tmp.dest-pnf-name + '/p-interfaces/p-interface/'
+ + $tmp.encoded-dest-p-interface + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="logical-link" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/logical-links/logical-link/' + $tmp.encoded-link-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="configuration-name" value="`$tmp.configuration-name`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="configuration-selflink" value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/'
+ + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failure updating configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="allotted-resource" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/' + $service-data.service-information.global-customer-id
+ + '/service-subscriptions/service-subscription/' + $port-mirror-topology-operation-input.service-information.subscription-service-type
+ + '/service-instances/service-instance/' + $tmp.service-instance-id
+ + '/allotted-resources/allotted-resource/' + $cto-api.contrail-route-allotted-instance-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.parent-service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-name'
+ value='`$tmp.configuration-name`' />
+ </set>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='`$service-data.provided-configurations.provided-configuration_length`' />
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='`$tmp.provided-conf-idx + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/' + $tmp.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-action'
+ value='`$port-mirror-topology-operation-input.request-information.request-action`' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="200" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml new file mode 100755 index 0000000..2cdd98d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml @@ -0,0 +1,124 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='port-mirror-topology-operation-assign-sync' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION and PORT_MIRROR_CAPABILITY tables" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find PORT_MIRROR_CONFIGURATION entry for ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 2`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 2 entries for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'collector'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No collector capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[1].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 1 entry for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Port mirror configuration ' + $tmp.pm.configuration-id + ' already exists'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='N' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml new file mode 100644 index 0000000..8b07ec1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml @@ -0,0 +1,88 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-async' mode='sync'> + <block atomic="true"> + <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'> + <outcome value='pprobe'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' /> + </set> + </outcome> + <outcome value='PPROBE'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' /> + </set> + </outcome> + <outcome value='vprobe'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + <outcome value='VPROBE'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + <outcome value=''> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + </switch> + <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find assign async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find activate async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find deactivate async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml new file mode 100644 index 0000000..0860c6b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml @@ -0,0 +1,293 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-create-vnfcs' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.vnfc-objects-idx' value='0' /> + </set> + <for silentFailure='true' index='src-li-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key' + value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name' + value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id' + value='`$tmp.src-vnf-id`' /> + </set> + <set> + <parameter name='tmp.vserver-id' value='0' /> + </set> + <for index='rel-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship_length`' > + <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`"> + <outcome value='true'> + <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' > + <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' /> + </set> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <switch test='`$tmp.vserver-id == 0`'> + <outcome value='true'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`" /> + </return> + </block> + </outcome> + </switch> + <for index='src-vs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id == $tmp.vserver-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name' + value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id' + value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id`' /> + <parameter name='tmp.vs-idx' value='`$src-vs-idx`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.interface-ids_length' value='0' /> + </set> + <for silentFailure='true' index='src-vli-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].network-name == $tmp.src-network-name`'> + <outcome value='true'> + <set> + <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].interface-id`' /> + <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' /> + </set> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.vnic-idx' value='0' /> + </set> + <for silentFailure='true' index='src-rs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity' + value='`$tmp.src-pps`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity' + value='0' /> + </set> + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + </set> + </outcome> + </switch> + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + </outcome> + </switch> + <set> + <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='0' /> + </set> + <for silentFailure='true' index='dest-li-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key' + value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id' + value='`$tmp.dest-vnf-id`' /> + </set> + <set> + <parameter name='tmp.vserver-id' value='0' /> + </set> + <for index='rel-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship_length`' > + <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`"> + <outcome value='true'> + <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' > + <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' /> + </set> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <switch test='`$tmp.vserver-id == 0`'> + <outcome value='true'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`" /> + </return> + </block> + </outcome> + </switch> + <for index='dest-vs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id == $tmp.vserver-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id' + value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id`' /> + <parameter name='tmp.vs-idx' value='`$dest-vs-idx`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.interface-ids_length' value='0' /> + </set> + <for silentFailure='true' index='dest-vli-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].network-name == $tmp.dest-network-name`'> + <outcome value='true'> + <set> + <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].interface-id`' /> + <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' /> + </set> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.vnic-idx' value='0' /> + </set> + <for silentFailure='true' index='dest-rs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity' + value='`$tmp.dest-pps`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity' + value='0' /> + </set> + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + </set> + </outcome> + </switch> + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + </outcome> + </switch> + <set> + <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml new file mode 100644 index 0000000..50c52fb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml @@ -0,0 +1,373 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-deactivate-async' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <set> + <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.' + value='`$port-mirror-topology-operation-input.sdnc-request-header.`' /> + </set> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='policy-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='success'> + <set> + <parameter name='l-interface-set[$src-idx]' value='true' /> + </set> + </outcome> + </update> + </block> + </for> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.src-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' /> + <parameter name='cto-api.collector-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='cto-api.rollback-flag' value='false' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-deactivate' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </outcome> + </call> + </block> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Unable to find configuration object in AAI" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failure updating configuration object in AAI" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </update> + <set> + <parameter name='pm.configuration-data.configuration-oper-status.order-status' + value='Created' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-action' + value='`$port-mirror-topology-operation-input.request-information.request-action`' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action' + value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="200" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='success'> + <parameter name='error-code' value='200' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml new file mode 100644 index 0000000..4a1fc27 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml @@ -0,0 +1,57 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-deactivate-sync' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.pm.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='N' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml new file mode 100644 index 0000000..0be852c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml @@ -0,0 +1,184 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-disable' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id + == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='src-idx' value='`$idx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$src-idx`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" /> + </return> + </outcome> + </switch> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml new file mode 100644 index 0000000..b6d8c6d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml @@ -0,0 +1,231 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-enable' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id + == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='src-idx' value='`$idx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$src-idx`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" /> + </return> + </outcome> + </switch> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + </outcome> + <outcome value='pprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='vni' value='1000' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='juniper-header' value='false' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="true" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml new file mode 100644 index 0000000..aaead56 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml @@ -0,0 +1,108 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-mapping-pprobe' mode='sync'> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interfaces" + key="pnf.pnf-name = $tmp.dest-pnf-name AND + p-interface.interface-name = $tmp.dest-p-interface AND depth='all'" + pfx='aai.pnf.p-interface' local-only='false' > + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Destination L-Interfaces are not set for the Destination PNF" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error retrieving l-interfaces from AAI" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.pnf.p-interface.l-interface_length > 0`'> + <outcome value='false'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Destination L-Interface is not set for the Destination PNF" /> + </return> + </outcome> + </switch> + <set> + <parameter name='tmp.found-one' value='false' /> + </set> + <for index='idx' start='0' end='`$aai.pnf.p-interface.l-interface_length`' > + <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='tmp.found-one' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='tmp.found-one' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-one`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Destination Port IP Address is not set for the Destination PNF' /> + </return> + </outcome> + </switch> + <set> + <parameter name='map-idx' value='0' /> + </set> + <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id' + value='`$aai.pnf.p-interface.l-interface[$idx].interface-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name' + value='`$aai.pnf.p-interface.l-interface[$idx].interface-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address' + value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address' + value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + <set> + <parameter name='map-idx' value='`$map-idx + 1`' /> + </set> + </block> + </for> + </for> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length' + value='`$map-idx`' /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml new file mode 100644 index 0000000..5421853 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml @@ -0,0 +1,243 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-mapping-vprobe' mode='sync'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select vnics_group_id + from VNICS_CAPACITY_GROUP + where service_instance_id = $tmp.service-instance-id + and nfc_naming_code = $tmp.dest-nfc-naming-code + and vnf_id = $tmp.dest-vnf-id' + pfx='db'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='not-found'> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CAPACITY_GROUP + (service_instance_id, nfc_naming_code, vnf_id) + VALUES ( $tmp.service-instance-id , $tmp.dest-nfc-naming-code , $tmp.dest-vnf-id )" + pfx='pfx' > + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='success'> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select vnics_group_id + from VNICS_CAPACITY_GROUP + where service_instance_id = $tmp.service-instance-id + and nfc_naming_code = $tmp.dest-nfc-naming-code + and vnf_id = $tmp.dest-vnf-id' + pfx='db'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + </get-resource> + </outcome> + </save> + </outcome> + </get-resource> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' + value='`$db.vnics-group-id`' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity, vnic_capacity + from VNICS_CAPACITY + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name' + pfx='db.vnics-capacity'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='not-found'> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CAPACITY + (vnics_group_id, vnic_port_name, available_capacity, vnic_capacity) + VALUES ( $db.vnics-group-id , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity + )" + pfx='pfx' > + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY table" /> + </return> + </outcome> + </save> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity' + value='`$db.vnics-capacity.available-capacity`' /> + </set> + </outcome> + </get-resource> + </for> + </for> + <set> + <parameter name='map-idx' value='0' /> + </set> + <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.found-capacity' value='N' /> + <parameter name='tmp.save-rem-cap' value='0' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.rem-cap' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity + - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + </set> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].capacity.vnic-capacity + <= $tmp.rem-cap`'> + <outcome value='true'> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value=''> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <switch test='`$tmp.rem-cap > $tmp.save-rem-cap`'> + <outcome value='true'> + <set> + <parameter name='tmp.found-capacity' value='Y' /> + <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' /> + <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' /> + <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <switch test='`$tmp.rem-cap > $tmp.save-rem-cap`'> + <outcome value='true'> + <set> + <parameter name='tmp.found-capacity' value='Y' /> + <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' /> + <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' /> + <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + </for> + <switch test="`$tmp.found-capacity == 'N'`"> + <outcome value='true'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No capacity for source interface ' + + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity' + value='`$tmp.src-pps + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity`' /> + </set> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + <set> + <parameter name='map-idx' value='`$map-idx + 1`' /> + </set> + </block> + </for> + </for> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length' + value='`$map-idx`' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity + from VNICS_CAPACITY + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name' + pfx='db.vnics-capacity'> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure reading VNICS_CAPACITY table" /> + </return> + </outcome> + </get-resource> + <set> + <parameter name='tmp.original-avail-capacity' value='`$db.vnics-capacity.available-capacity`' /> + <parameter name='tmp.original-used-capacity' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" +key="update VNICS_CAPACITY + set available_capacity = $tmp.avail-capacity + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name +" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure updating VNICS_CAPACITY table" /> + </return> + </outcome> + </update> + </block> + </for> + </for> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CONFIGURATION_ID + (configuration_id, vnics_group_id) + values ( $tmp.configuration-id , $db.vnics-group-id )" + pfx='pfx' ></save> + <return status='success'> + <parameter name='' value='' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml new file mode 100644 index 0000000..673c513 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml @@ -0,0 +1,153 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.rollback-flag' value='false' /> + <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + </call> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + </call> + </block> + </outcome> + </switch> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id + + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name + + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" /> + </set> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="logical-link" + key="logical-link.link-name = $tmp.link-name" > + <outcome value='failure'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to delete logical-link in AAI: ' + $tmp.link-name`" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + </delete> + </block> + </for> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Unable to find configuration object in AAI" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure updating configuration object in AAI" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failed to delete port-mirror-configuration object in MD-SAL" /> + </return> + </outcome> + </execute> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml new file mode 100755 index 0000000..5a8dad5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml @@ -0,0 +1,237 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='port-mirror-topology-operation-validation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No service exists for service instance ' + $port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="No configuration-id supplied in input" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='PPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='VPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-sub-type must be pprobe or vprobe" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-type is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-information.onap-model-information.model-customization-uuid is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="source vnf-id is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest vnf-id is required for vprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='pprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest pnf-name is required for pprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for unassign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='enable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='disable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml new file mode 100644 index 0000000..fb3cdb2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml @@ -0,0 +1,90 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-validation' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-unassign' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='enable'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-enable' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='disable'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-disable' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + </switch> + <set> + <parameter name='service-object-path' value="`'/config/GENERIC-RESOURCE-API:services/service/' + + $port-mirror-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology'`" /> + <parameter name='port-mirror-object-path' value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/' + + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml new file mode 100755 index 0000000..2558152 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml @@ -0,0 +1,34 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='preload-network-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.'
+ value='`$preload-network-topology-operation-input.preload-network-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml new file mode 100755 index 0000000..91fd4a7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml @@ -0,0 +1,34 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='preload-vf-module-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-vf-module-topology-information.vf-module-topology.vf-module-topology-identifier.vf-module-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-vf-module-topology-information.'
+ value='`$preload-vf-module-topology-operation-input.preload-vf-module-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml new file mode 100755 index 0000000..0f27169 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml @@ -0,0 +1,935 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc="process-eipam-pools" mode="sync">
+ <switch test='`$tmp.process-eipam-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name='tmp.location8' value='' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='' />
+ <parameter name='tmp.l3-network.level1.v4.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='' />
+ <parameter name='tmp.l3-network.level1.v6.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='' />
+ <parameter name='tmp.l3-network.level2.v4.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='' />
+ <parameter name='tmp.l3-network.level2.v6.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='false' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name="string" value="`$aai.complex.physical-location-id`" />
+ <parameter name="result" value="tmp.location8"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="8" />
+ </execute>
+ <set>
+ <parameter name='tmp.region' value='`$aai.complex.region`' />
+ <parameter name='tmp.cloud-region-id' value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name='tmp.physical-location-id' value="`$aai.complex.physical-location-id`" />
+ <parameter name="tmp.clli" value="`$aai.complex.physical-location-id`" />
+ <parameter name="tmp.zone" value="`$aai.cloud-region.cloud-zone`" />
+ <parameter name="tmp.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="tmp.service-type" value="`$network-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ <parameter name="tmp.level1-key-value" value="`$tmp.location8 + ':' + $aai.cloud-region.cloud-region-id`" />
+ <parameter name="tmp.level2-key-value" value="`$network-model.network-role + ':' + $tmp.l3-network.network-id`" />
+ <parameter name="tmp.ipv4-cidr-mask" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="tmp.ipv6-cidr-mask" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='pidx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv4_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv6_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-network-role-pool' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while allocating subnet in EIPAM. Error creating level 1 pool. ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.pool.pre-existing' value='`$eipam-pool.v4.pre-existing`'/>
+ <parameter name='tmp.l3-network.level1.v6.pool.pre-existing' value='`$eipam-pool.v6.pre-existing`'/>
+ </set>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = 1 and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level1 ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = 1 and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level1 ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level1.v6.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-network-role-pool' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Error creating level 2 pool, need to attempt rollback"/>
+ </record>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error creating level 2 pool" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.pre-existing' value='`$eipam-pool.v4.pre-existing`'/>
+ <parameter name='tmp.l3-network.level2.v6.pre-existing' value='`$eipam-pool.v6.pre-existing`'/>
+ </set>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level2"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level2"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$eipam-ip-block.subnet-size-override-v4`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level2"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level2"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level2 ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level2.v4.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$eipam-ip-block.subnet-size-override-v6`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level2 ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level2.v6.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Invalid option to process-eipam" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Invalid option to process-eipam" />
+ </return>
+ </outcome>
+ </switch>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml new file mode 100755 index 0000000..d713d23 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml @@ -0,0 +1,661 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <!--This DG relys on generate-FQPN to determine the key_names & key_values for all levels for the specified plan-name.-->
+ <method rpc="process-generic-eipam-pools" mode="sync">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <!-- <parameter name="tmp.network-id" value="`$tmp.l3-network.network-id`" /> -->
+ <parameter name="tmp.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ </set>
+ <switch test='`$tmp.service-type`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.service-type" value="`$service-data.service-information.subscription-service-type`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-name`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology-identifier-structure.network-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.zone`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.zone" value="`$aai.cloud-region.cloud-zone`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-collection`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-collection" value="`$aai-network-collection.collection-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.aic-cloud-region`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.location-clli8`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.complex-region`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v4FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v6FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='pidx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv4_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv6_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="l-idx" start="1" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length + 1`">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.level" value='`$l-idx`' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-generic-pool' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Error creating pool for level"/>
+ <parameter name="field5" value="`$l-idx`"/>
+ </record>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="`$l-idx`"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ <parameter name="field12" value="Successful" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value=""></outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v4.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v4.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field5" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v6.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v6.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </for>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml new file mode 100644 index 0000000..64e5765 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml @@ -0,0 +1,199 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='query-aai-l3-network-by-network-role' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.service-instance-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.network-role`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.network-role is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.aai.l3-networks.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $query-aai-l3-network-by-network-role-input.network-role"
+ pfx='tmp.aai.l3-networks' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No active l3-network found in AAI with cloud_region_id '
+ + $vnf-topology-operation-input.vnf-request-information.aic-cloud-region + ' and network_role '
+ + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving l3-network from AAI with network-role = ' + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$tmp.aai.l3-networks.l3-network_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$tmp.aai.l3-networks.l3-network[0].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.l3-network-found' value='0' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='0' />
+ </set>
+ <for index='network-index' start='0' end='`$tmp.aai.l3-networks.l3-network_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='cloud-region'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='cloud.matched.l3-networks[$cloud.matched.l3-networks_length].'
+ value='$tmp.aai.l3-networks.l3-network[$network-index].' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='`$cloud.matched.l3-networks_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <switch test='`$cloud.matched.l3-networks_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[0].`' />
+ <!--
+ <parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <block>
+ <for index='cidx' start='0' end='`$cloud.matched.l3-networks_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship_length`' >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[$cidx].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[$cidx].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[$cidx].network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='tmp.l3-network-found' value='1' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.l3-network-found`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' and service-instance-id=' + $query-aai-l3-network-by-network-role-input.service-instance-id + ' found in AAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml new file mode 100644 index 0000000..6a4ca1b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml @@ -0,0 +1,46 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='rollback-eipam-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_ASSIGNMENTS
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-id'>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status'
+ value="`'PENDING_DELETE_' + $vnf-topology-operation-input.vnf-request-information.vnf-id`" />
+ <parameter name='service-data.service-information.service-type'
+ value='NOT_APPLICABLE' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table on rollback." />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in EIPAM unassign IP address on rollback." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml new file mode 100644 index 0000000..41a6468 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml @@ -0,0 +1,341 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='rollback-generated-names' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rollback-generated-names-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.context-id can not be null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rollback-generated-names-input.naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.naming-type can not be null" />
+ </return>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VM_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vm_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VNFC_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnfc_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='CLIENT_KEY'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='EIPAM_CLIENT_KEY_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='NETWORK_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='network_instance_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <block>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='service_instance_name_prefix' />
+ </set>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id AND prefix IS NULL AND name_index IS NULL'></delete>
+ </block>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown rollbck-generated-name-input.naming-type: ' + $rollback-generated-names-input.naming-type`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='db.grn.' value='' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT distinct prefix from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id'
+ pfx='db.grn.distinct-prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table to retrieve distinct prefix"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.grn.distinct-prefix_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for index='prefix-index' start='0' end='`$db.grn.distinct-prefix_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='db.grn.subset.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.grn.prefix' value='`$db.grn.distinct-prefix[$prefix-index].prefix`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.subset[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'No entry found in GENERIC_RESOURCE_NAME where context_id = ' + $rollback-generated-names-input.context-id + ' and type = ' + $rollback-generated-names-input.naming-type + ' and prefix = ' + $db.grn.distinct-prefix[$prefix-index].prefix`"/>
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'SELECT * from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`" pfx='db.grn.index-table'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error reading the '
+ + $rollback-generated-names.index-table-name
+ + ' table with ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'No entries found in '
+ + $rollback-generated-names.index-table-name
+ + ' with '
+ + $rollback-generated-names.name-prefix-column
+ + ' = '
+ + $tmp.rb.grn.prefix `" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ <set>
+ <parameter name='tmp.rb.grn.max-index'
+ value='`$db.grn.subset[$db.grn.subset_length - 1].name-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.delta-index'
+ value='`$db.grn.index-table.index-number - $tmp.rb.grn.max-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.net-index'
+ value='`$db.grn.index-table.index-number - $db.grn.subset_length`' />
+ </set>
+ <switch test="`$tmp.rb.delta-index == 0`">
+ <outcome value='true'>
+ <switch test="`$tmp.rb.net-index == 0`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ </switch>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting GENERIC_RESOURCE_NAME WHERE type = '
+ + $rollback-generated-names-input.naming-type
+ + ' AND context_id = ' + $rollback-generated-names-input.context-id
+ + ' AND prefix = '+ $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </delete>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.grn.last-max-index'
+ value='`$db.grn.prefix[$db.grn.prefix_length - 1].name-index`' />
+ </set>
+ <switch test="`$tmp.rb.net-index > $tmp.rb.grn.last-max-index`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml new file mode 100755 index 0000000..f49173a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml @@ -0,0 +1,150 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-activate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="in-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml new file mode 100755 index 0000000..cb8450b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml @@ -0,0 +1,348 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-assign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" /> + <parameter name="outputPath" value="tmp.vnf-p-ar-url" /> + <parameter name="target" value="{service-instance-id}" /> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.vnf-p-ar-url`" /> + <parameter name="outputPath" value="tmp.vnf-p-ar-url" /> + <parameter name="target" value="{vnf-id}"/> + <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + <outcome value='PendingDelete'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <set> + <parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$security-zone-topology-operation-input.service-information.service-instance-id` " /> + <parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id` " /> + <parameter name='sz-ar-identifiers.allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.' +value="`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.`" /> + </set> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-invariant-uuid' +value="`$ar-model.invariant-uuid`" /> + </set> + </outcome> + </switch> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-uuid' +value="`$ar-model.uuid`" /> + </set> + </outcome> + </switch> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-version'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-version' +value="`$ar-model.version`" /> + </set> + </outcome> + </switch> + <switch test='`$ar-model.ecomp-generated-naming`'> + <outcome value='Y'> + <block atomic="true"> + <switch test='`$ar-model.naming-policy`'> + <outcome value='oam_security_zone_name'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/> + </execute> + <set> + <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/> + </execute> + <set> + <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.allotted-resource-identifiers.' +value="`$sz-ar-identifiers.`" /> + </set> + <set> + <parameter name='sz-ar-assignments.vlan-tag' value="`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag` " /> + <parameter name='sz-ar-assignments.trusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role` " /> + <parameter name='sz-ar-assignments.untrusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role` " /> + <parameter name='sz-ar-assignments.security-zone-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' ></call> + <set> + <parameter name='sz-ar-assignments.security-zone-name-untrusted' value="`$tmp.untrust-sz` " /> + <parameter name='sz-ar-assignments.security-zone-name-trusted' value="`$tmp.trust-sz` " /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.security-zone-assignments.' +value="`$sz-ar-assignments.`" /> + </set> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value=''> + <set> + <parameter name='tmp.cidx' value="`0`" /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" /> + </set> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$cidx`' /> + <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' /> + <parameter name='tmp.found-cidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-cidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="description" value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`" /> + <parameter name="selflink" value="`$tmp.ar.self-link`" /> + <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" /> + <parameter name="model-version-id" value="`$ar-model.uuid`" /> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml new file mode 100755 index 0000000..a234d0d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml @@ -0,0 +1,127 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-create' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='PendingCreate'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml new file mode 100755 index 0000000..14ecf29 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml @@ -0,0 +1,150 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml new file mode 100755 index 0000000..acad449 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml @@ -0,0 +1,130 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-delete' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <set> + <parameter name='sz-ar-assignments.' value="" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml new file mode 100755 index 0000000..0f11b39 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml @@ -0,0 +1,105 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' > + <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> + <parameter name='contextPrefix' value='prop' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml new file mode 100755 index 0000000..5cb18ae --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml @@ -0,0 +1,56 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='security-zone-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-security-zone-input' mode='sync' ></call> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-assign' mode='sync' ></call> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-activate' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-unassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml new file mode 100644 index 0000000..6631d89 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml @@ -0,0 +1,156 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-aai-pnf-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <for silentFailure='true' index="aidx" start="0" end="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`">
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].name`'>
+ <outcome value='pnf-name'>
+ <set>
+ <parameter name='ss.param.pnf-name' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-name-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='pnf-name2'>
+ <set>
+ <parameter name='ss.param.pnf-name2' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-name2-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='pnf-id'>
+ <set>
+ <parameter name='ss.param.pnf-id' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-id-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-pnf-put'>
+ <set>
+ <parameter name='ss.param.aai-pnf-put-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv6-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv6-oam-address' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.ipv6-oam-address-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $ss.param.pnf-name "
+ pfx="tmp.aai.pnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get pnf with pnf-name=' + $ss.param.pnf-name + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'pnf with pnf-name=' + $ss.param.pnf-name + ' not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="ss.selflink"
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id +
+ '/service-data/pnfs/pnf/' +
+ $ss.param.pnf-id +
+ '/pnf-data/pnf-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $ss.param.pnf-name " >
+ <parameter name="pnf-name2" value="`$ss.param.pnf-name2`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <parameter name="selflink" value="`$ss.selflink`" />
+ <parameter name="ipaddress-v4-oam" value="`$ss.param.ipv4-oam-address`" />
+ <parameter name="ipaddress-v6-oam" value="`$ss.param.ipv6-oam-address`" />
+ <parameter name="model-customization-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-customization-uuid`" />
+ <parameter name="model-invariant-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-uuid`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update pnf.pnf-name in AnAI with pnf-name=' + $ss.param.pnf-name`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'pnf with pnf-name =' + $ss.param.pnf-name + ' is not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-pnf-put.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml new file mode 100644 index 0000000..c64485b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml @@ -0,0 +1,6600 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-aai-vf-module-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='nidx' value='0' />
+ </set>
+ <for silentFailure='true' index="bidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`" >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="sriov"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="_net_id"/>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.network[$nidx].netid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ <set>
+ <parameter name='nidx' value='`$nidx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`'>
+ <outcome value='vf_module_id'>
+ <set>
+ <parameter name='ss.param.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module-name'>
+ <set>
+ <parameter name='ss.param.vf-module-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-id'>
+ <set>
+ <parameter name='ss.param.volume-group-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-name'>
+ <set>
+ <parameter name='ss.param.volume-group-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='aic-cloud-region'>
+ <set>
+ <parameter name='ss.param.aic-cloud-region' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='oam-interface-name'>
+ <set>
+ <parameter name='ss.param.oam-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.oam-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='=âlo0-interface-name'>
+ <set>
+ <parameter name='ss.param.lo0-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.lo0-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address-prefix'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address-prefix' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-prefix-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='loopback0_ipv4_address'>
+ <set>
+ <parameter name='ss.param.loopback0-ipv4-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.loopback0-ipv4-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-loopback0-address'>
+ <set>
+ <parameter name='ss.param.ipv4-loopback0-address' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-loopback0-address-index' value='`bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='as-number'>
+ <set>
+ <parameter name='ss.param.as-number' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.as-number-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-id-outer'>
+ <set>
+ <parameter name='ss.param.vlan-id-outer' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vlan-id-outer-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='availability_zone_0'>
+ <set>
+ <parameter name='ss.param.availability-zone-0' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.availability-zone-0-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vf-module-put'>
+ <block>
+ <set>
+ <parameter name='ss.param.aai-vf-module-put-index' value='`$bidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='generic-vnf'>
+ <set>
+ <parameter name='ss.resource-key.generic-vnf' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module'>
+ <set>
+ <parameter name='ss.resource-key.vf-module' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group'>
+ <set>
+ <parameter name='ss.resource-key.volume-group' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc'>
+ <set>
+ <parameter name='ss.resource-key.vnfc' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='connection-points'>
+ <set>
+ <parameter name='ss.resource-key.connection-points' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l-interface'>
+ <set>
+ <parameter name='ss.resource-key.l-interface' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l3-netework'>
+ <set>
+ <parameter name='ss.resource-key.l3-network' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </for>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ </block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id "
+ pfx="tmp.aai.vnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get generic-vnf with vnf-id=' + $ss.param.vnf-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf.vnf-name with vnf-id=' + $ss.param.vnf-id + ' not found in AAI. '`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$ss.param.ipv4-loopback0-address != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.ipv4-loopback0-address`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.ipv4-loopback0-address = ' + $ss.param.ipv4-loopback0-address`"/>
+ <parameter name="field3" value="__SKIP ipv4-loopback0-address update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$ss.param.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.ipv4-loopback0-address in AnAI with ipv4-loopback0-address=' + $ss.param.ipv4-loopback0-address + '; ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.ipv4-loopback0-address-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.ipv4-oam-address != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.ipv4-oam-address`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.ipv4-oam-address = ' + $ss.param.ipv4-oam-address`"/>
+ <parameter name="field3" value="__SKIP ipv4-oam-address update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$ss.param.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.ipv4-oam-address in AnAI with ipv4-oam-address=' + $ss.param.ipv4-oam-address + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI' + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.ipv4-oam-address-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.as-number != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.as-number`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.as-number = ' + $ss.param.as-number`"/>
+ <parameter name="field3" value="__SKIP as-number update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$ss.param.as-number`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.as-number in AnAI with as-number=' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.as-number-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.vlan-id-outer != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.vlan-id-outer`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.vlan-id-outer = ' + $ss.param.vlan-id-outer`"/>
+ <parameter name="field3" value="__SKIP vlan-id-outer update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$ss.param.vlan-id-outer`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vlan-id-outer in AnAI with as-number=' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.vlan-id-outer-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.availability-zone-0 != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.availability-zone-0`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.availability-zone-0 = ' + $ss.param.availability-zone-0`"/>
+ <parameter name="field3" value="__SKIP availability-zone-0 update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.availability-zone.related-link'
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/' +
+ $prop.cloud-region.cloud-owner + '/' + $ss.param.aic-cloud-region +
+ '/availability-zones/availability-zone/' +
+ $ss.param.availability-zone-0`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.availability-zone.related-link`" />
+ <!--
+<parameter name="relationship-list.relationship[0].related-to" value="availability-zone" /><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="`$prop.cloud-region.cloud-owner`" /><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="`$ss.param.aic-cloud-region`" /><parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" /><parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$ss.param.availability-zone-0`" />
+-->
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.vlan-id-outer-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.vlan-id-outer update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.vlan-id-outer update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.vlan-id-outer update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save availability-zone relationship for generic-vnf in AnAI with availability-zone-name =' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.vlan-id-outer-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.vlan-id-outer update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.vlan-id-outer update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.vlan-id-outer update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to create availability-zone relationship because generic-vnf with vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.availability-zone-0-updated' value='true' />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id "
+ pfx="tmp.aai.vfmdoule" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get vf-module in AnAI with vf-module-id = ' + $ss.param.vf-module-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id=' + $ss.param.vf-module-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='ss.selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id +
+'/service-data/vnfs/vnf/' +
+$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id +
+'/vnf-data/vf-modules/vf-module/' +
+$ss.param.vf-module-id +
+'/vf-module-data/vf-module-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$ss.param.vf-module-name`' />
+ <parameter name="selflink" value='`$ss.selflink`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update vf-module-name with vf-module-id = ' + $ss.param.vf-module-id + ' in AnAI; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update vf-module-name with vf-module-id =' + $ss.param.vf-module-id + ' because vf-module is not found in AAI' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id"
+ pfx="tmp.aai.volume-group" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get volume-group in AnAI with volume-group-id = ' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'volume-group not found in AnAI with volume-group-id=' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$ss.param.volume-group-name`' />
+ <parameter name="volume-group-id" value='`$ss.param.volume-group-id`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to update volume-group with volume-group-id =' + $ss.param.volume-group-id + ' and volume-group-name = ' + $ss.param.volume-group-name + ' in AnAI.' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'volume-group not found in AnAI with volume-group-id=' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <parameter name="nfc-naming-code" value='`$ss.param.nfc-naming-code`' />
+ <parameter name="nfc-function" value='`$ss.param.nfc-function`' />
+ <parameter name="model-customization-id" value='`$ss.param.vnfc-model-customization-uuid`' />
+ <parameter name="model-invariant-id" value='`$ss.param.vnfc-model-invariant-uuid`' />
+ <parameter name="model-version-id" value='`$ss.param.vnfc-model-version`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vnfc with vnfc-name =' + $ss.param.vnfc-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vnfc with vnfc-name =' + $ss.param.vnfc-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.connection-points`">
+ <outcome value='connection-points'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="cp.cp-instance-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id
+ AND vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <parameter name="cp-instance-id"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create connection-point with cp-instance-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create connection-point with cp-instance-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <parameter name="vlan-tag-id"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid`' />
+ <parameter name="vlan-tag-role"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-tag-description`' />
+ <parameter name="vlan-id-outer"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-tag-id`' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.cp.related-link'
+ value="`'/aai/v$/network/vnfcs/vnfc/' +
+ $ss.param.vnfc-name +
+ '/cps/cp/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag:relationship-list"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.cp.related-link`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create cp relationship for vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create cp relationship for vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="interface-name" value='`$ss.param.oam-interface-name`' />
+ <parameter name="interface-role" value='OAM' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.oam-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.oam-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="l3-interface-ipv4-address-list.l3-interface-ipv4-address = $ss.param.ipv4-oam-address
+ AND generic-vnf.vnf-id = $ss.param.vnf-id
+ AND l-interface.interface-name = $ss.param.oam-interface-name" >
+ <parameter name="l3-interface-ipv4-address" value='`$ss.param.ipv4-oam-address`' />
+ <parameter name="l3-interface-ipv4-prefix-length" value='`$ss.param.ipv4-oam-address-prefix`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.ipv4-oam-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.ipv4-oam-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="interface-name" value='`$ss.param.lo0-interface-name`' />
+ <parameter name="interface-role" value='loopback' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="l3-interface-ipv4-address-list.l3-interface-ipv4-address = $ss.param.ipv4-loopback0-address
+ AND generic-vnf.vnf-id = $ss.param.vnf-id
+ AND l-interface.interface-name = $ss.param.lo0-interface-name" >
+ <parameter name="l3-interface-ipv4-address" value='`$ss.param.ipv4-loopback0-address`' />
+ <parameter name="l3-interface-ipv4-prefix-length" value='32' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.loopback0-ipv4-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.loopback0-ipv4-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.l3-network.related-link'
+ value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.l3-network.related-link`" />
+ <!--
+<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="`$ss.network[$n].netid`" />
+-->
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create generic-vnf releationship for l3-network with network-id =' + $ss.network[$n].netid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create generic-vnf releationship for l3-network with network-id =' + $ss.network[$n].netid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].value'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='nidx' value='0' />
+ </set>
+ <for silentFailure='true' index="bidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`" >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="sriov"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="_net_id"/>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.network[$nidx].netid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ <set>
+ <parameter name='nidx' value='`$nidx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`'>
+ <outcome value='vf_module_id'>
+ <set>
+ <parameter name='ss.param.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_name'>
+ <set>
+ <parameter name='ss.param.vf-module-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-id'>
+ <set>
+ <parameter name='ss.param.volume-group-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-name'>
+ <set>
+ <parameter name='ss.param.volume-group-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='aic-cloud-region'>
+ <set>
+ <parameter name='ss.param.aic-cloud-region' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='oam-interface-name'>
+ <set>
+ <parameter name='ss.param.oam-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.oam-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='=âlo0-interface-name'>
+ <set>
+ <parameter name='ss.param.lo0-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.lo0-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address-prefix'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address-prefix' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-prefix-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='loopback0_ipv4_address'>
+ <set>
+ <parameter name='ss.param.loopback0-ipv4-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.loopback0-ipv4-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-loopback0-address'>
+ <set>
+ <parameter name='ss.param.ipv4-loopback0-address' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-loopback0-address-index' value='`bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='as-number'>
+ <set>
+ <parameter name='ss.param.as-number' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.as-number-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-id-outer'>
+ <set>
+ <parameter name='ss.param.vlan-id-outer' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vlan-id-outer-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='availability_zone_0'>
+ <set>
+ <parameter name='ss.param.availability-zone-0' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.availability-zone-0-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vf-module-put'>
+ <block>
+ <set>
+ <parameter name='ss.param.aai-vf-module-put-index' value='`$bidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='generic-vnf'>
+ <set>
+ <parameter name='ss.resource-key.generic-vnf' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module'>
+ <set>
+ <parameter name='ss.resource-key.vf-module' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group'>
+ <set>
+ <parameter name='ss.resource-key.volume-group' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc'>
+ <set>
+ <parameter name='ss.resource-key.vnfc' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='connection-points'>
+ <set>
+ <parameter name='ss.resource-key.connection-points' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l-interface'>
+ <set>
+ <parameter name='ss.resource-key.l-interface' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l3-netework'>
+ <set>
+ <parameter name='ss.resource-key.l3-network' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </for>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='tmp.return-failure' value ='true' />
+ </set>
+ <block atomic='true'>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-vfput.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml new file mode 100644 index 0000000..877c272 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml @@ -0,0 +1,434 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-aai-vnf-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <for silentFailure='true' index="aidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].name`'>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='ss.param.vnf-name' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.vnf-name-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_id'>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.vnf-id-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='ss.param.license-assignment-group-uuid' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.license-assignment-group-uuid-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='ss.param.entitlement-assignment-group-uuid' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.entitlement-assignment-group-uuid-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vnf-put'>
+ <set>
+ <parameter name='ss.param.aai-vnf-put-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='license-key'>
+ <set>
+ <parameter name='ss.param.license-key' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.license-key-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <set>
+ <parameter name='ss.param.entitlement-key' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.entitlement-key-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id "
+ pfx="tmp.aai.vnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get generic-vnf with vnf-id=' + $ss.param.vnf-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf.vnf-name with vnf-id=' + $ss.param.vnf-id + ' not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="ss.selflink"
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id +
+ '/service-data/vnfs/vnf/' +
+ $ss.param.vnf-id +
+ '/vnf-data/vnf-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value="`$ss.param.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="selflink" value="`$ss.selflink`" />
+ <parameter name="model-customization-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid`" />
+ <parameter name="model-invariant-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-uuid`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vnf-name in AnAI with vnf-name=' + $ss.param.vnf-name`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf with vnf-id =' + $ss.param.vnf-id + ' is not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <switch test="`$ss.param.license-assignment-group-uuid != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.license-assignment-group-uuid`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.license-assignment-group-uuid = ' + $ss.param.license-assignment-group-uuid`"/>
+ <parameter name="field3" value="__SKIP saving license object in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="group-uuid" value='`$ss.param.license-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$ss.param.license-key`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AA. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.license-updated' value='true' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.entitlement-assignment-group-uuid != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.entitlement-assignment-group-uuid`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <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="`'ss.param.entitlement-assignment-group-uuid = ' + $ss.param.entitlement-assignment-group-uuid`"/>
+ <parameter name="field3" value="__SKIP saving entitlement object in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="entitlement"
+ key="entitlement.group-uuid = $ss.param.entitlement-assignment-group-uuid
+ AND entitlement.resource-uuid = $ss.param.entitlement-key
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="group-uuid" value='`$ss.param.entitlement-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$ss.param.entitlement-key`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <switch test="`$ss.license-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK license"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key" >
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license because license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' NOT FOUND in AAI. SILENT SUCCESS! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of license completed. '`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save entitlement with group-uuid = ' + $ss.param.entitlement-assignment-group-uuid + ' AND entitlement.resource-uuid = ' + $ss.param.entitlement-key + ' in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <switch test="`$ss.license-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK license"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key" >
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license because license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' NOT FOUND in AAI. SILENT SUCCESS! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of license completed. '`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'entitlement with group-uuid = ' + $ss.param.entitlement-assignment-group-uuid + ' AND entitlement.resource-uuid = ' + $ss.param.entitlement-key + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-vnfput.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml new file mode 100644 index 0000000..d3dce91 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml @@ -0,0 +1,281 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-capability-param-resolution' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='vf-module'>
+ <switch test="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='pnf'>
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-capability-param-resolution"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml new file mode 100644 index 0000000..a8ef58d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml @@ -0,0 +1,50 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-generate-name-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test='`$ss.input.param.index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="ss.input.param.index is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.service-data.param.index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="ss.service-data.param.index is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-generate-name-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='vf-module'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-generate-name-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown capability-type [' + $ss.capability-type + '], valid value are: vnf, pnf, vf-module'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml new file mode 100644 index 0000000..c6b5a9a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml @@ -0,0 +1,31 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-generate-name' mode='sync'>
+ <block atomic="true">
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-generate-name' mode='sync' ></call>
+ </outcome>
+ <outcome value='vf-module'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-generate-name' mode='sync' ></call>
+ </outcome>
+ <outcome value='pnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-generate-name' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml new file mode 100644 index 0000000..60c749a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml @@ -0,0 +1,625 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-mS-mac-address-assign' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-name`">
+ <outcome value='Other'>
+ <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="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <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="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <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="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='mS-mac-address-assign'>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-name is mS-mac-address-assign"/>
+ </record>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action`">
+ <outcome value='Other'></outcome>
+ <outcome value=''>
+ <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="self-serve-mS-mac-address-assign: ss.capability-action is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-action is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value='assign'>
+ <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="self-serve-mS-mac-address-assign: ss.capability-action is assign"/>
+ </record>
+ </outcome>
+ <outcome value='unassign'>
+ <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="self-serve-mS-mac-address-assign: ss.capability-action is unassign"/>
+ </record>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <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="self-serve-mS-mac-address-assign: call self-serve-capability-param-resolution DG"/>
+ </record>
+ <set>
+ <!--<parameter name='name' value='value' />-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <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="self-serve-mS-mac-address-assign: Failure calling self-serve-capability-param-resolution"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='402' />
+ <parameter name='error-message' value='Failure calling self-serve-capability-param-resolution' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'></outcome>
+ </call>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='ma.elements.element_length' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters-length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <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="self-serve-mS-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <set>
+ <parameter name='vfModuleParamsCapabilityName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name`' />
+ <parameter name='tmp.vnfHostName' value='' />
+ <parameter name='tmp.policyInstanceName' value='' />
+ <parameter name='tmp.cloudParamName' value='' />
+ <parameter name='tmp.swName' value='' />
+ <parameter name='tmp.resourceValue' value='' />
+ </set>
+ <switch test="`$ss.capability-name == $vfModuleParamsCapabilityName`">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: Found ss.capability-name MATCH"/>
+ </record>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.resourceValue' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.cloudParamName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].name`' />
+ </set>
+ <set>
+ <parameter name='tmp.resource-resolution-data.' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.`' />
+ </set>
+ <switch test="`$tmp.resource-resolution-data.status == 'PENDING'`">
+ <outcome value='false'>
+ <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="self-serve-mS-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='reseouce-resolution-data.status is not PENDING' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
+ </set>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <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="self-serve-mS-mac-address-assign: key-index"/>
+ <parameter name="field3" value='`$key-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name`">
+ <outcome value='key'>
+ <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="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = vnf-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.vnfHostName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <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="self-serve-mS-mac-address-assign: resolved vnfHostName: "/>
+ <parameter name="field3" value='`$tmp.vnfHostName`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='policy-instance-name'>
+ <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="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = policy-instance-name-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.policyInstanceName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <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="self-serve-mS-mac-address-assign: resolved policyInstanceName: "/>
+ <parameter name="field3" value='`$tmp.policyInstanceName`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='sw-name'>
+ <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="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = sw-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.swName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <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="self-serve-mS-mac-address-assign: resolved swName: "/>
+ <parameter name="field3" value='`$tmp.swName`'/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.vnfHostName`">
+ <outcome value='null'>
+ <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="self-serve-mS-mac-address-assign: vnfHostName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vnfHostName is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <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="self-serve-mS-mac-address-assign: vnfHostName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vnfHostName is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.cloudParamName`">
+ <outcome value='null'>
+ <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="self-serve-mS-mac-address-assign: cloudParamName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='cloudParamName is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <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="self-serve-mS-mac-address-assign: cloudParamName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='cloudParamName is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.policyInstanceName`">
+ <outcome value='null'>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: policyInstanceName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='policyInstanceName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: policyInstanceName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='policyInstanceName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.swName`">
+ <outcome value='null'>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: swName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='swName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: swName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='swName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ma.elements.element[$ma.elements.element_length].policy-instance-name' value='`$tmp.policyInstanceName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].vnf-host-name' value='`$tmp.vnfHostName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].cloud-param-name' value='`$tmp.cloudParamName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].sw-name' value='`$tmp.swName`' />
+ </set>
+ <switch test="`$tmp.resourceValue`">
+ <outcome value='Other'>
+ <set>
+ <parameter name='ma.elements.element[$ma.elements.element_length].resource-value' value='`$tmp.resourceValue`' />
+ </set>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value=''></outcome>
+ </switch>
+ <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="self-serve-mS-mac-address-assign: Adding this vf-module-parameters.param to ma.elements "/>
+ <parameter name="field3" value='`$ma.elements.element_length`'/>
+ <parameter name="field4" value='`$ma.elements.element[$ma.elements.element_length].policy-instance-name`'/>
+ <parameter name="field5" value='`$ma.elements.element[$ma.elements.element_length].vnf-host-name`'/>
+ <parameter name="field6" value='`$ma.elements.element[$ma.elements.element_length].cloud-param-name`'/>
+ <parameter name="field7" value='`$ma.elements.element[$ma.elements.element_length].sw-name`'/>
+ <parameter name="field8" value='`$ma.elements.element[$ma.elements.element_length].resource-value`'/>
+ </record>
+ <set>
+ <parameter name='ma.elements.element_length' value='`$ma.elements.element_length + 1`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='prop.restapi.templateDir' value="/opt/lsc/restapi/templates" />
+ <parameter name='prop.mac-address-microserivice.url' value="http://mtanjv9sdlg51-eth1-0.aic.cip.att.com:8989" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: restapi-call-node Call MAC Address microService assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/mac-address-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.mac-address-microserivice.url + '/macaddress/service/assign'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="Authorization=Basic YWRtaW46YWRtaW4=" />
+ <parameter name="responsePrefix" value="tmp.mac-address-resp.prefix" />
+ <outcome value='failure'>
+ <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="self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service assign' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <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="self-serve-mS-mac-address-assign: assign SUCCESS"/>
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <for index='mac-address-list-index' start='0' end='`$tmp.mac-address-resp.prefix.mac-address-list_length`' >
+ <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="self-serve-mS-mac-address-assign: mac-address-list-index|name|value "/>
+ <parameter name="field3" value='`$mac-address-list-index`'/>
+ <parameter name="field4" value='`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name`'/>
+ <parameter name="field5" value='`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].value`'/>
+ </record>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <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="self-serve-mS-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].name`">
+ <outcome value='true'>
+ <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="self-serve-mS-mac-address-assign: mac-address-list MATCH with param.value: "/>
+ <parameter name="field3" value="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name' value='INPUT' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].value`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status`" value='SUCCESS' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.restapi.templateDir' value="/opt/lsc/restapi/templates" />
+ <parameter name='prop.mac-address-microserivice.url' value="http://mtanjv9sdlg51-eth1-0.aic.cip.att.com:8989" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: restapi-call-node Call MAC Address microService unassign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/mac-address-unassign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.mac-address-microserivice.url + '/macaddress/service/unassign'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="Authorization=Basic YWRtaW46YWRtaW4=" />
+ <parameter name="responsePrefix" value="tmp.mac-address-resp.prefix" />
+ <outcome value='failure'>
+ <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="self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service unassign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service unassign' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <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="self-serve-mS-mac-address-assign: unassign SUCCESS: response: "/>
+ <parameter name='field3' value='`$tmp.mac-address-resp.prefix.status`' />
+ </record>
+ <switch test="`$tmp.mac-address-resp.prefix.status == 'deleted successfully'`">
+ <outcome value='false'>
+ <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="self-serve-mS-mac-address-assign: Address Micro Service unassign did not return: deleted successfully"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Address Micro Service unassign did not return: deleted successfully' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status`" value="DELETED" />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/self-serve-mS-mac-address-assign.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml new file mode 100644 index 0000000..0b2cde9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml @@ -0,0 +1,744 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-mS-vlan-tag-assign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Not all assignments are resolved' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='qidx' value='0' />
+ <parameter name='ss.vt.' value='' />
+ </set>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.vt.param[$qidx].index' value='`$pidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='policy-instance-name'>
+ <set>
+ <parameter name='vt.request[$qidx].policy-instance-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='resource-name'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='scope-id'>
+ <set>
+ <parameter name='vt.request[$qidx].scope-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-key'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-tag-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-type'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='resource-value'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ <parameter name='target' value='$' />
+ <outcome value='false'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-value' value='' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='qidx' value='`$qidx + 1`' />
+ </set>
+ <set>
+ <parameter name='vt.request_length' value='`$qidx`' />
+ </set>
+ <set>
+ <parameter name='ss.vt.param_length' value='`$qidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$ss.capability-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.assign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to get vlan-tag assisgnment from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to get vlan-tag assisgnment from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Encountered error from mS-vlan-tag-assign with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block atomic='true'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vm-type'>
+ <set>
+ <parameter name='ss.param.vm-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vm-type-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.param.vnfc-name-unresolved-value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$ss.param.vnfc-name-unresolved-value`" />
+ <parameter name="target" value="${"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="ss.param.vnfc-name-unresolved-value"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$ss.param.vnfc-name-unresolved-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="ss.param.vnfc-name-unresolved-value"/>
+ </execute>
+ <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="`'ss.param.vnfc-name-unresolved-value = ' + $ss.param.vnfc-name-unresolved-value`"/>
+ </record>
+ <block>
+ <for silentFailure='true' index="x" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$x].name == $ss.param.vnfc-name-unresolved-value`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$x].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$x`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$ss.param.vnfc-name`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to resolve vnfc-name; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-type' value = '`$ss.param.vm-type`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-invariant-uuid' value = '`$ss.param.vnfc-model-invariant-uuid`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-customization-uuid' value = '`$ss.param.vnfc-model-customization-uuid`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-version' value = '`$ss.param.vnfc-model-version`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-name' value = '`$ss.param.vnfc-name`' />
+ </set>
+ <set>
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length' value = '1' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names_length' value = '1' />
+ </set>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="vtidx" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$vtidx].index`' />
+ </set>
+ <switch test='`$vtResp.output[$oidx].resource-name == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].name`'>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value'
+ value='`$vtResp.output[$oidx].resource-value`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='vnfc-network-role'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].vnfc-network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-cp-instance-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error in generating cp-instance-id in SDNC; ' + $error-message.generate-cp-instance-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' index="sidx" start="0" end="`$vtResp.output[$oidx].stored-elements_length`">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.connection-point-id'
+ value='`$tmp.return.generate-cp-instance-id.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-uuid'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlan-uuid`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-id'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-description'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-role'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].element-vlan-role`' />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value'
+ value='`$vtResp.output[$oidx].resource-value`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='vnfc-network-role'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].vnfc-network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-cp-instance-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error in generating cp-instance-id in SDNC; ' + $error-message.generate-cp-instance-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' index="sidx" start="0" end="`$vtResp.output[$oidx].stored-elements_length`">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.connection-point-id'
+ value='`$tmp.return.generate-cp-instance-id.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-uuid'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlan-uuid`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-id'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-description'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-role'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].element-vlan-role`' />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.capability-name'
+ value='INPUT' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length'
+ value='`$ss.vt.param_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data_length'
+ value='`$vtResp.output[$oidx].stored-elements_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <set>
+ <parameter name='qidx' value='0' />
+ <parameter name='ss.vt.' value='' />
+ </set>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.vt.param[$qidx].index' value='`$pidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='policy-instance-name'>
+ <set>
+ <parameter name='vt.request[$qidx].policy-instance-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-type'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-key'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-tag-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='qidx' value='`$qidx + 1`' />
+ </set>
+ <set>
+ <parameter name='vt.request_length' value='`$qidx`' />
+ </set>
+ <set>
+ <parameter name='ss.vt.param_length' value='`$qidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$ss.capability-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to unassign vlan-tag from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to unassign vlan-tag from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Encountered error while unassigning mS-vlan-tag with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-mS-vlan-tag-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: mS-vlan-tag-assign"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml new file mode 100644 index 0000000..4cf5cdb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml @@ -0,0 +1,414 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='self-serve-netbox-ip-assign' mode='sync'> + <block atomic="true"> + <switch test='`$ss.capability-name`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-name is null" /> + </return> + </outcome> + </switch> + <switch test='`$ss.capability-action`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-action is null" /> + </return> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' > + <outcome value='failure'> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Not all assignments are resolved' + $error-message`" /> + </return> + </outcome> + </call> + <switch test="`$ss.capability-type == 'vnf'`"> + <outcome value='true'> + <block> + <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' > + <set> + <parameter name='tmp.ss.param.capability-name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' /> + </set> + <set> + <parameter name='tmp.ss.param.name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name`' /> + </set> + <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'> + <outcome value='true'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vnf-id'> + <set> + <parameter name='tmp.ss.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'> + <outcome value='FAILED'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vnf-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='PENDING'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vnf-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'> + <outcome value='SUCCESS'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + </for> + <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="`'SS: pidx: ' + $pidx`"/> + </record> + </block> + </outcome> + </switch> + <switch test="`$ss.capability-type == 'vf-module'`"> + <outcome value='true'> + <block> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <set> + <parameter name='tmp.ss.param.capability-name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' /> + </set> + <set> + <parameter name='tmp.ss.param.name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`' /> + </set> + <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'> + <outcome value='true'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vf-module-id'> + <set> + <parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='ip-address-id'> + <set> + <parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'> + <outcome value='FAILED'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='PENDING'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'> + <outcome value='SUCCESS'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + </for> + <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="`'SS: pidx: ' + $pidx`"/> + </record> + </block> + </outcome> + </switch> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml new file mode 100644 index 0000000..55d851c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml @@ -0,0 +1,400 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-pnf-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-pnf' value='true' />
+ </set>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$pf-topology-operation-input.pnf-details.pnf-id == $service-data.pnfs.pnf[$idx].pnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-pnf' value='false' />
+ </set>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-pnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='`$service-data.pnfs.pnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='`$service-data.pnfs.pnf_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-pnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-id`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-type'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-type`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.tenant'
+ value='`$pnf-topology-operation-input.pnf-request-input.tenant`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.aic-cloud-region'
+ value='`$pnf-topology-operation-input.pnf-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-id'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-id`' />
+ </set>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.pnf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-uuid'
+ value='`$db.pnf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-version'
+ value='`$db.pnf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-version'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-name'
+ value='`$db.pnf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-name'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-customization-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.'
+ value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.'
+ value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.'
+ value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.'
+ value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.'
+ value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='aai-get' />
+ <parameter name='ss.capability.execution-order[1]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[7]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[8]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[11]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[12]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[13]' value='aai-pnf-put' />
+ <parameter name='ss.capability.execution-order_length' value='14' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='pnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.'
+ value='pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE with pnf-ra-assigment"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='pf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='pf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='pf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='pf.pnf-data.pnf-details.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='pf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='pf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.request-version'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.request-version`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-name`' />
+ <parameter name='pf.pnf-data.pnf-request-input.tenant'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.tenant`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-cloud-region'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-cloud-region`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-clli'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='pf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='pf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='pf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='pf.pnf-data.pnf-details.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='pf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='pf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.request-version'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.request-version`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-name`' />
+ <parameter name='pf.pnf-data.pnf-request-input.tenant'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.tenant`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-cloud-region'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-cloud-region`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-clli'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml new file mode 100644 index 0000000..bded0cb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml @@ -0,0 +1,233 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-pnf-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.pnf-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml new file mode 100644 index 0000000..cff4d49 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml @@ -0,0 +1,235 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-pnf-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.pnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.pnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$pnf-topology-operation-input.pnf-details.pnf-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$pnf-topology-operation-input.pnf-details.pnf-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param_length`' >
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.sdnc-artifact-name' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].name + '":"' + $pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.sdnc-artifact-name == ''`">
+ <outcome value='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No VF_MODEL found where customization_uuid = ' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ <parameter name='tmp.sdnc-artifact-name' value='`$db1.vf-model.sdnc-artifact-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $pnf-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"pnf-model-customization-uuid":"' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"pnf-id":"' + $pnf-topology-operation-input.pnf-details.pnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"aic-cloud-region":"' + $pnf-topology-operation-input.pnf-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.sdnc-artifact-name`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name="responsePrefix" value="`$responsePrefix`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for silentFailure='true' index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' value='`$highnum + 1`'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: pnf-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-pnf-ra-assignment-' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.pnf-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml new file mode 100644 index 0000000..2fc4a3a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml @@ -0,0 +1,143 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-pnf-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='pnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='vf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='vf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='vf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='vf.pnf-data.pnf-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='vf.pnf-data.pnf-request-input.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.`' />
+ <parameter name='vf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='vf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='vf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve pnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve pnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve pnf assignments for ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml new file mode 100644 index 0000000..75f5a3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml @@ -0,0 +1,100 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-process-vfmodule-mapping-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resolution-summary_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resolution-summary_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='CONSTANT' value='success'/>
+ </set>
+ <for silentFailure='true' index='vdns-index' start='0' end='`$jsonContextPrefix.resolution-summary_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='param-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$param-index].name == $jsonContextPrefix.resolution-summary[$vdns-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$param-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ <set>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].name`'/>
+ </set>
+ <switch test="`$jsonContextPrefix.resolution-summary[$vdns-index].status == 'success' and
+ $jsonContextPrefix.resolution-summary[$vdns-index].value == ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`'
+ value='`$CONSTANT`'/>
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].dictionary-source`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].status`'/>
+ </set>
+ <for silentFailure='true' index='kid-index' start='0' end='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$kid-index].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].name`'/>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$kid-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].value`'/>
+ </set>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key_length'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' />
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vfmodule-mapping-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml new file mode 100644 index 0000000..b2746cf --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml @@ -0,0 +1,99 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-process-vfmodule-template-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resource-accumulator-resolved-data_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource-accumulator-resolved-data_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].value`'
+ value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vfmodule-template-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml new file mode 100644 index 0000000..551364f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml @@ -0,0 +1,100 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-process-vnf-mapping-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resolution-summary_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resolution-summary is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='CONSTANT' value='success'/>
+ </set>
+ <for silentFailure='true' index='vdns-index' start='0' end='`$jsonContextPrefix.resolution-summary_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='param-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].name == $jsonContextPrefix.resolution-summary[$vdns-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ <set>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].name`'/>
+ </set>
+ <switch test="`$jsonContextPrefix.resolution-summary[$vdns-index].status == 'success' and
+ $jsonContextPrefix.resolution-summary[$vdns-index].value == ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`'
+ value='`$CONSTANT`'/>
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='kid-index' start='0' end='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$kid-index].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].name`'/>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$kid-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].value`'/>
+ </set>
+ </for>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].dictionary-source`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].status`'/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' />
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vnf-mapping-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml new file mode 100644 index 0000000..2e62832 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml @@ -0,0 +1,104 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-process-vnf-template-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resource-accumulator-resolved-data_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource-accumulator-resolved-data_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for silentFailure='true' index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vnf-template-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml new file mode 100644 index 0000000..ebd065a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml @@ -0,0 +1,612 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-unresolved-composite-data' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-type`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-type is null" />
+ </return>
+ </outcome>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <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="`'SS: tmp.ss.composite: ' + $tmp.ss.composite`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="comma-splits" />
+ </execute>
+ <for silentFailure='true' index="comma-splits-index" start="0" end="`$comma-splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$comma-splits[$comma-splits-index]`" />
+ <parameter name="outputPath" value="tmp.ss.composite.trim"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='' />
+ <parameter name='tmp.ss.param-suffix' value='' />
+ </set>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite.trim`" />
+ <parameter name="regex" value="\$"/>
+ <parameter name="ctx_memory_result_key" value="dollar-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='`$dollar-splits[0]`' />
+ </set>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-prefix`" />
+ <parameter name="outputPath" value="tmp.ss.param-prefix"/>
+ </execute>
+ <switch test='`$dollar-splits_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.param-prefix`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index="dollar-splits-index" start="1" end="`$dollar-splits_length`">
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'$' + $dollar-splits[$dollar-splits-index]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$dollar-splits[$dollar-splits-index]`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="regex" value="\}"/>
+ <parameter name="ctx_memory_result_key" value="end-curly-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$end-curly-splits[0]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-suffix' value='`$end-curly-splits[1]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-suffix`" />
+ <parameter name="outputPath" value="tmp.ss.param-suffix"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'${' + $tmp.ss.partial.composite-value + '}'`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <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="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value="`$tmp.ss.param-prefix + $tmp.ss.partial.resolved-value + $tmp.ss.param-suffix`" />
+ </set>
+ <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="`'SS: tmp.ss.partial.resolved-value: ' + $tmp.ss.partial.resolved-value`"/>
+ </record>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.final.composite-resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </for>
+ </block>
+ <switch test='`$comma-splits-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <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="`'SS: tmp.ss.composite: ' + $tmp.ss.composite`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="comma-splits" />
+ </execute>
+ <for silentFailure='true' index="comma-splits-index" start="0" end="`$comma-splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$comma-splits[$comma-splits-index]`" />
+ <parameter name="outputPath" value="tmp.ss.composite.trim"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='' />
+ <parameter name='tmp.ss.param-suffix' value='' />
+ </set>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite.trim`" />
+ <parameter name="regex" value="\$"/>
+ <parameter name="ctx_memory_result_key" value="dollar-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='`$dollar-splits[0]`' />
+ </set>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-prefix`" />
+ <parameter name="outputPath" value="tmp.ss.param-prefix"/>
+ </execute>
+ <switch test='`$dollar-splits_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.param-prefix`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index="dollar-splits-index" start="1" end="`$dollar-splits_length`">
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'$' + $dollar-splits[$dollar-splits-index]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$dollar-splits[$dollar-splits-index]`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="regex" value="\}"/>
+ <parameter name="ctx_memory_result_key" value="end-curly-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$end-curly-splits[0]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-suffix' value='`$end-curly-splits[1]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-suffix`" />
+ <parameter name="outputPath" value="tmp.ss.param-suffix"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'${' + $tmp.ss.partial.composite-value + '}'`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <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="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value="`$tmp.ss.param-prefix + $tmp.ss.partial.resolved-value + $tmp.ss.param-suffix`" />
+ </set>
+ <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="`'SS: tmp.ss.partial.resolved-value: ' + $tmp.ss.partial.resolved-value`"/>
+ </record>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.final.composite-resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </for>
+ </block>
+ <switch test='`$comma-splits-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-composite.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml new file mode 100644 index 0000000..d2bb3a0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml @@ -0,0 +1,302 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vfmodule' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-vfmodule' value='false' />
+ </set>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-name'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-type'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.tenant'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-cloud-region'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.aic-clli`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.sdnc-generated-cloud-resources'
+ value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[7]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[11]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[12]' value='aai-vf-module-put' />
+ <parameter name='ss.capability.execution-order_length' value='13' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.'
+ value='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vfmodule-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE with vfmodule-ra-assignment"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.xml new file mode 100644 index 0000000..1c5e077 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.xml @@ -0,0 +1,85 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-forking-logic' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.vf_module_label' value='false' />
+ </set>
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.exist.vf_module_label' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.vf_module_label == 'true'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT sdnc_model_name from VF_MODEL
+ WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid
+ AND sdnc_model_name is not null'
+ pfx='db.vf-model-name'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table to determine self-serve forking criteria" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL
+ WHERE vf_customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid
+ AND vf_module_label is not null '
+ pfx='db.vf-module-label'>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table to determine self-serve forking criteria" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml new file mode 100644 index 0000000..e2dc3e3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml @@ -0,0 +1,92 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-generate-name-changeassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.external-key.value' value='' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
+ <outcome value='external-key'>
+ <set>
+ <parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.external-key.value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="self-service-vf-module-generate-name-changeassign error : external-key is null for vf-module" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vf-module.changeassign.naming-data-payload" value="`'{"elements":[{' + '"resource-name":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
+ </set>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.vf-module.changeassign.naming-data-payload`' />
+ <parameter name="prifix" value="vf-module.changeassign.nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module" key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id AND vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id " >
+ <parameter name="vf-module-name" value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].value`' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml new file mode 100644 index 0000000..01ec0d4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml @@ -0,0 +1,233 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml new file mode 100644 index 0000000..76b6087 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml @@ -0,0 +1,75 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-mdsal-put' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vf-module assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vf-module assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml new file mode 100644 index 0000000..68df95e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml @@ -0,0 +1,159 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vf-module-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml new file mode 100644 index 0000000..543b9f5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml @@ -0,0 +1,70 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vfmodule-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no param name/value provided in vf-module-request-input" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.input.param.found.in.service.param' value='false' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].name == $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='ss.input.param.index' value='`$i`' />
+ <parameter name='ss.service-data.param.index' value='`$j`' />
+ <parameter name='ss.input.param.found.in.service.param' value='true' />
+ <parameter name='ss.capability-type' value='vf-module' />
+ <parameter name='ss.capability-action' value='changeassign' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-name-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ </call>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$ss.input.param.found.in.service.param`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vf-module-request-input.vf-module-input-parameters.param[].name found in service-data." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml new file mode 100644 index 0000000..9038e67 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml @@ -0,0 +1,204 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vfmodule-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name + '":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.vf-module-label == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No VF_MODEL found with customization_uuid = ' + $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vf_module_label is not null'
+ pfx='db1.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'vf_module_label not found in VF_MODULE_MODEL WHERE customization_uuid = ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$db1.vf-module-model.vf-module-label`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $vf-module-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"vnf-id":"' + $vf-module-topology-operation-input.vnf-information.vnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"vf-module-model-customization-uuid":"' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"vnf-model-customization-uuid":"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload8" value="`$tmp.config-name-value-payload7 + '"vf-module-id":"' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload9" value="`$tmp.config-name-value-payload8 + '"aic-cloud-region":"' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload9 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.vf-module-label`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="raAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from ConfigAssignmentNode" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from ConfigAssignmentNode" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.resolved-data.' + $tmp.vf-module-label`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-mapping-ra-response' mode='sync' ></call>
+ </outcome>
+ <outcome value='failure'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.vf-module-label`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to parse RA respose from mapping or meshed-template" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-template-ra-response' mode='sync' ></call>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: vfmodule-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vfmodule-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml new file mode 100644 index 0000000..96db3ef --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml @@ -0,0 +1,287 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vnf' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-vnf' value='false' />
+ </set>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$service-data.vnfs.vnf_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.'
+ value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.'
+ value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.'
+ value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.'
+ value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.'
+ value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[7]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[11]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[12]' value='aai-vnf-put' />
+ <parameter name='ss.capability.execution-order_length' value='13' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml new file mode 100644 index 0000000..16da1bb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml @@ -0,0 +1,70 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-changeassign' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no param name/value provided in vnf-request-input" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.input.param.found.in.service.param' value='false' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name == $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='ss.input.param.index' value='`$i`' />
+ <parameter name='ss.service-data.param.index' value='`$j`' />
+ <parameter name='ss.input.param.found.in.service.param' value='true' />
+ <parameter name='ss.capability-type' value='vnf' />
+ <parameter name='ss.capability-action' value='changeassign' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-name-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ </call>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$ss.input.param.found.in.service.param`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-request-input.vnf-input-parameters.param[].name found in service-data." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml new file mode 100644 index 0000000..3570e5d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml @@ -0,0 +1,54 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-forking-logic' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.sdnc-artifact-name' value='false' />
+ </set>
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-artifact-name' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.sdnc-artifact-name == 'true'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$db.vf-model.sdnc-model-name != '' and $db.vf-model.sdnc-artifact-name != ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml new file mode 100644 index 0000000..c8a419a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml @@ -0,0 +1,94 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-generate-name-changeassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.external-key.value' value='' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
+ <outcome value='external-key'>
+ <set>
+ <parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.external-key.value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="self-service-vnf-generate-name-changeassign error : external-key is null for vnf" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vnf.changeassign.naming-data-payload"
+ value="`'{"elements":[{' + '"resource-name":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
+ </set>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.vnf.changeassign.naming-data-payload`' />
+ <parameter name="prifix" value="vnf.changeassign.nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id " >
+ <parameter name="vnf-name" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].value`' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml new file mode 100644 index 0000000..4a87679 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml @@ -0,0 +1,233 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml new file mode 100644 index 0000000..a35b4c1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-mdsal-put' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.request-version`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-name`' />
+ <parameter name='vf.vnf-data.vnf-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.tenant`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-cloud-region`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vnf assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vnf assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml new file mode 100644 index 0000000..420bdf3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml @@ -0,0 +1,179 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vnf-topology-operation-input.vnf-information.vnf-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$vnf-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.sdnc-artifact-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name + '":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.sdnc-artifact-name == ''`">
+ <outcome value='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ <parameter name='tmp.sdnc-artifact-name' value='`$db1.vf-model.sdnc-artifact-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $vnf-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"vnf-model-customization-uuid":"' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"vnf-id":"' + $vnf-topology-operation-input.vnf-information.vnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"aic-cloud-region":"' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.sdnc-artifact-name`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name="responsePrefix" value="raAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.resolved-data.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vnf-mapping-ra-response' mode='sync' ></call>
+ </outcome>
+ <outcome value='failure'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to parse RA respose from mapping or meshed-template" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vnf-template-ra-response' mode='sync' ></call>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-vnf-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vnf-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml new file mode 100644 index 0000000..b640fbf --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml @@ -0,0 +1,143 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve vnf assignments for ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml new file mode 100644 index 0000000..aee8feb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml @@ -0,0 +1,46 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='send-so-response' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name="so.response-message" value="`$error-message`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'so-response.xml'`" />
+ <parameter name='restapiUrl' value="`$so.notification-url`" />
+ <parameter name='restapiUser' value='`$prop.so.user`' />
+ <parameter name='restapiPassword' value='`$prop.so.pwd`' />
+ <parameter name='accept' value='text/plain' />
+ <parameter name='format' value='xml' />
+ <parameter name='contentType' value='application/xml' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="soResponse-vnf-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Error sending SO response. ' + $error-message`" />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Error sending SO response. ' + $error-message`" />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml new file mode 100755 index 0000000..7983036 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml @@ -0,0 +1,185 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading SERVICE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.service-instance-name' value='' />
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-instance-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.service-model.ecomp-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.service-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='service_instance_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$db.service-model.service-instance-name-prefix + '_'`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generated-via-policy' value='true' />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.service-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.service-model.service-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to generate service name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value='`$naming-policy-generate-name-output.service-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
+ <parameter name='generate-unique-name-input.service-instance-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value="`$service-topology-operation-input.service-request-input.service-instance-name`" />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <set>
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-id'
+ value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.service-type'
+ value='`$service-topology-operation-input.service-information.subscription-service-type`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-name'
+ value='`$tmp.service-instance-name`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.global-customer-id'
+ value='`$service-topology-operation-input.service-information.global-customer-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
+ value='`$service-topology-operation-input.service-information.onap-model-information.`' />
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`' >
+ <set>
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-name'
+ value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].name`' />
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-value'
+ value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].value`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='assign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml new file mode 100755 index 0000000..c018b1a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml @@ -0,0 +1,63 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'changeassign' then request-action must be 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading SERVICE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
+ value='`$service-topology-operation-input.service-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='changeassign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml new file mode 100755 index 0000000..89cc3eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $service-data.service-topology.service-topology-identifier.global-customer-id AND
+ service-subscription.service-type = $service-data.service-topology.service-topology-identifier.service-type AND
+ service-instance.service-instance-id = $service-topology-operation-input.service-information.service-instance-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='deactivate' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='DeleteServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml new file mode 100755 index 0000000..5270874 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml @@ -0,0 +1,100 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'delete' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot delete the service because there are networks defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot delete the service because there are VNFs defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot deactivate this service because there are consumed allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$service-data.service-topology.onap-model-information.model-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.' value='' />
+ <parameter name='service-status.' value='' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml new file mode 100755 index 0000000..1cf7718 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml @@ -0,0 +1,41 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-service-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$service-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$service-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$service-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$service-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='delete'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$service-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml new file mode 100644 index 0000000..4d75a2f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml @@ -0,0 +1,133 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-activate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $tunnelxconn-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $tunnelxconn-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+
+
+<!--
+
+<set>
+$tunnelxconn-topology-operation-input.service-information.global-customer-id
+$tunnelxconn-topology-operation-input.service-information.subscription-service-type
+
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+
+ $tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id
+
+--><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml new file mode 100644 index 0000000..58f73f8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml @@ -0,0 +1,272 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.search.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='Other'>
+
+<call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' >
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set><set>
+<parameter name='tx-ar-identifiers.consuming-service-instance-id' value="`$tunnelxconn-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='tx-ar-identifiers.parent-service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='tx-ar-identifiers.allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='tx-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.'
+value="`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_network_policy'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.' value="`$tx-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='tmp.vni' value='123' />
+<parameter name='tmp.vgmux-bearer-ip' value='127.0.0.1' />
+<parameter name='tmp.vgmux-lan-ip' value='127.0.0.1' /></set><switch test="`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length != ''`">
+<outcome value='true'>
+<for index='curidx' start='0' end='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length`' >
+<switch test='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-name`'>
+<outcome value='vgmux_private_ip_0'>
+<set>
+<parameter name='tmp.vgmux-lan-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome><outcome value='vgmux_private_ip_2'>
+<set>
+<parameter name='tmp.vgmux-bearer-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome></switch></for></outcome></switch><set>
+<parameter name='tmp.manageVni.action' value='reserve' />
+<parameter name='tmp.manageIpaddr.action' value='reserve' />
+<parameter name='tmp.manageVni.pool' value='VNI'/>
+<parameter name='tmp.manageIpaddr.pool' value='VGW'/></set><call module='GENERIC-RESOURCE-API' rpc='manage-vni-assignment' mode='sync' >
+</call><call module='GENERIC-RESOURCE-API' rpc='manage-ipaddr-assignment' mode='sync' >
+</call><set>
+<parameter name='tx-ar-assignments.vni' value='`$tmp.manageVni.vni`'/>
+<parameter name='tx-ar-assignments.vgmux-bearer-ip' value='`$tmp.vgmux-bearer-ip`'/>
+<parameter name='tx-ar-assignments.vgmux-lan-ip' value='`$tmp.vgmux-lan-ip`'/>
+<parameter name='tx-ar-assignments.vg-ip' value='`$tmp.manageIpaddr.ip`'/>
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[0].name' value='VNI'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[0].value' value='`$tmp.manageVni.vni`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[1].name' value='vgmux_private_ip_2'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[1].value' value='`$tmp.vgmux-bearer-ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[2].name' value='vgmux_private_ip_0'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[2].value' value='`$tmp.vgmux-lan-ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[3].name' value='vgw_private_ip_0'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[3].value' value='`$tmp.manageIpaddr.ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters_length' value='4'/>
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.'
+value="`$tx-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
+<outcome value='false'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+</set></block></outcome></switch></block></outcome></switch><set>
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='service-data.service-information.global-customer-id' value='`$tunnelxconn-topology-operation-input.service-information.global-customer-id`' />
+<parameter name='service-data.service-information.subscription-service-type' value='`$tunnelxconn-topology-operation-input.service-information.subscription-service-type`' />
+<!--
+<parameter name='service-data.service-information.service-instance-id' value='`$tunnelxconn-topology-operation-input.service-information.service-instance-id`' />
+-->
+<parameter name='service-data.service-information.service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`"/></set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" /><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
+</return></outcome></call></outcome></execute></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml new file mode 100644 index 0000000..8071065 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml @@ -0,0 +1,300 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='tunnelxconn-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/tunnelxconn-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-tx-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+ </set>
+ <switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+ <parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+ <parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ </set>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length`' >
+ <!--
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ -->
+ <switch test='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <!--
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ -->
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ <!--
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+
+ -->
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ <parameter name='tmp.tunnel-dest-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-src-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip` " />
+ <parameter name='tmp.tunnel-vni' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vBRG-name` " />
+ <parameter name='tmp.tunnel-dest-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ <parameter name='tmp.tunnel-src-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip` " />
+ <parameter name='tmp.tunnel-vni' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.xconnect.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vBRG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.xconnect.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $tunnelxconn-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml new file mode 100644 index 0000000..dc24e03 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml @@ -0,0 +1,117 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-deactivate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml new file mode 100644 index 0000000..d70fb60 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml @@ -0,0 +1,268 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='tunnelxconn-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/tunnelxconn-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-tx-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+ </set>
+ <switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+ <parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+ <parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <set>
+ <parameter name='tx-ar-assignments.' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vBRG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $tunnelxconn-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml new file mode 100644 index 0000000..eaab7f2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml @@ -0,0 +1,80 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-unassign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml new file mode 100644 index 0000000..277b74d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml @@ -0,0 +1,26 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-tunnelxconn-input' mode='sync' >
+</call><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml new file mode 100644 index 0000000..bf041b1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml @@ -0,0 +1,319 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='validate-api-contrail-route-input' mode='sync'> + <block atomic="true"> + <switch test='`$ctotmp.action`'> + <outcome value='create'> + <block atomic="true"> + <switch test='`$cto-api.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.port-mirror-configuration-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.port-mirror-configuration-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.source-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.source-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-owner`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.cloud-owner is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.service-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.service-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.src-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.src-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.rollback-flag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.rollback-flag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.configuration-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.configuration-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml new file mode 100644 index 0000000..73bb52d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml @@ -0,0 +1,118 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='validate-bbs-network-input-parameters' mode='sync'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='create'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='CreateAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='CreateInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='DeleteInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='update'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + <outcome value='ChangeInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" /> + </return> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="svc-action is null" /> + </return> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml new file mode 100644 index 0000000..7f72fbd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml @@ -0,0 +1,118 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-bbs-vnf-input-parameters' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ <outcome value='ChangeInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="svc-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml new file mode 100644 index 0000000..57b493f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml @@ -0,0 +1,116 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='validate-brg-input' mode='sync'>
+<block atomic="true"><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.vgmux-bearer-ip`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.vni`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.brg-wan-mac-address `'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='create'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml new file mode 100644 index 0000000..ec0301a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml @@ -0,0 +1,331 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-connection-attachment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sotnVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='clientSignal'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-provider-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-client-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-topology-id'></outcome>
+ <outcome value='access-node-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cVLAN'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sdwanVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='role'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml new file mode 100755 index 0000000..421335d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml @@ -0,0 +1,337 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='validate-contrail-route-input' mode='sync'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block></block> + </outcome> + <outcome value='DeleteContrailRouteInstance'> + <block></block> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required input" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Invalid request-information.request-action " /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.service-information.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="service-information.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-information.onap-model-information.model-customization-uuid is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-topology-operation-input.contrail-route-request-input.dest-network.network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid' + pfx='ar-model'> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=assign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateNetworkInstance for svc-action=create" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=activate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=deactivate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=delete" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=unassign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml new file mode 100755 index 0000000..cc1bc1a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml @@ -0,0 +1,108 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-generic-configuration-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Service instance ' + $generic-configuration-topology-operation-input.service-information.service-instance-id + ' does not exist'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='unassign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unsupported svc-action ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml new file mode 100755 index 0000000..3489544 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml @@ -0,0 +1,107 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-getpathsegment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateForwardingPathInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE invariant_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for invariant UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml new file mode 100644 index 0000000..0987a77 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml @@ -0,0 +1,311 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="validate-network-input-parameters" mode="sync">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`">
+ <outcome value="create">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="CreateNetworkInstance">
+ <block atomic="true">
+ <for index="i" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <set>
+ <parameter name="tmp.name" value="" />
+ <parameter name="tmp.value" value="" />
+ </set>
+ <set>
+ <parameter name="tmp.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].name`" />
+ <parameter name="tmp.value" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].value`" />
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value="name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="service-type">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="site1-name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="site2-name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="sna1_name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="sna2_name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="pe1_id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="pe2_id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1-id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2-id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1-ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2-ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1_peer_ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2_peer_ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1_svlan">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2_svlan">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be CreateNetworkInstance for svc-action=create" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value="activate">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="ActivateDCINetworkInstance">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-overlay-network-input-parameters" mode="sync" />
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be ActivateNetworkInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="deactivate">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeActivateDCINetworkInstance">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id" />
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeactivateNetworkInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="delete">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeleteNetworkInstance">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id" />
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml new file mode 100644 index 0000000..87cf448 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml @@ -0,0 +1,596 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-network-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Network id proveded but no network exists that matches"/>
+ <parameter name="field5" value="`$network-topology-operation-input.network-information.network-id`"/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Network instance group id proveded but no network instance group exists that matches"/>
+ <parameter name="field5" value="`$network-topology-operation-input.network-information.network-instance-group-id`"/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be CreateNetworkInstance for svc-action=assign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='ActivateSOTNConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='ActivateDCINetworkInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be CreateNetworkInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.from-preload`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.from-preload is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be CreateNetworkInstance for svc-action=changeassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeactivateSOTNConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeActivateDCINetworkInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeleteNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=unassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml new file mode 100644 index 0000000..2e16622 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="validate-overlay-network-input-parameters" mode="sync">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block atomic="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_networkName'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_networkName" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_networkName'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_networkName" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_routerId'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_routerId" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_routerId'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_routerId" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_importRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_importRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_importRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site2_importRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_exportRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT2'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_exportRT2" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_vni'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_vni'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site2_vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$validate.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="`$network-topology-operation-input.network-request-input.network-input-parameters.site1_routerId`" value="" />
+ <parameter name="`$network-topology-operation-input.network-request-input.network-input-parameters.site2_routerId`" value="" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI" />
+ <outcome value="other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml new file mode 100644 index 0000000..3c1ae0d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml @@ -0,0 +1,86 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-pnf-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-details.pnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-details.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml new file mode 100755 index 0000000..0aaa7ba --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml @@ -0,0 +1,328 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='validate-security-zone-input' mode='sync'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block></block> + </outcome> + <outcome value='DeleteSecurityZoneInstance'> + <block></block> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required input" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Invalid request-information.request-action " /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.service-information.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="service-information.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-information.onap-model-information.model-customization-uuid is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.vlan-tag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.trusted-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-operation-input.security-zone-request-input.untrusted-network-role is a required input" /> + </return> + </outcome> + </switch> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid' + pfx='ar-model'> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml new file mode 100755 index 0000000..ca1c3a4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml @@ -0,0 +1,117 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-service-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.global-customer-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.global-customer-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml new file mode 100644 index 0000000..58b7467 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml @@ -0,0 +1,106 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='validate-tunnelxconn-input' mode='sync'>
+<block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.brg-wan-mac-address`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-topology-operation-input.brg-wan-mac-address is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='create'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml new file mode 100644 index 0000000..f21ff99 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml @@ -0,0 +1,86 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-vf-module-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml new file mode 100644 index 0000000..6de5257 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml @@ -0,0 +1,77 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-vnf-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml new file mode 100755 index 0000000..0324511 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml @@ -0,0 +1,926 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-generate-heat-parameters' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='const.sub-int' value='subint' />
+ <parameter name='const.subnet-id' value='_subnet_id' />
+ <parameter name='const.v6-subnet-id' value='_v6_subnet_id' />
+ <parameter name='const.port' value='port' />
+ <parameter name='const.sub-int-count' value='_subintcount' />
+ <parameter name='const.vlan-ids' value='_vlan_ids' />
+ <parameter name='const.net-names' value='_net_names' />
+ <parameter name='const.net-ids' value='_net_ids' />
+ <parameter name='const.ip' value='_ip' />
+ <parameter name='const.v6-ip' value='_v6_ip' />
+ <parameter name='const.floating-ip' value='_floating_ip' />
+ <parameter name='const.floating-v6-ip' value='_floating_v6_ip' />
+ <parameter name='const.underscore' value='_' />
+ </set>
+ <set>
+ <parameter name='output-index' value='0' />
+ </set>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-name-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + '_name_'
+ + $vm-name-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ <switch test='`$vm-name-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + '_names'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v4`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.floating-ip`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v4`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v6`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.floating-v6-ip`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v6`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix_length > 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='cdl' value='[' />
+ </set>
+ <for index='interface-route-prefix-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix_length`' >
+ <block>
+ <switch test='`$interface-route-prefix-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ','`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='cdl' value="`$cdl
+ + '{\"interface_route_table_routes_route_prefix\":\"'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix[$interface-route-prefix-index]
+ + '\"}'`" />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='cdl' value="`$cdl + ']'`" />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_route_prefixes'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.ip
+ + $const.underscore
+ + $address-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$address-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_ips'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.v6-ip
+ + $const.underscore
+ + $address-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$address-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_v6_ips'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length > 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_vlan_filter'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='public-cdl' value='' />
+ <parameter name='private-cdl' value='' />
+ <parameter name='all-cdl' value='' />
+ </set>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.is-private`'>
+ <outcome value='true'>
+ <switch test='`$private-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='private-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='private-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$public-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='public-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='public-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$all-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='all-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='all-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$private-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_private_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$private-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$public-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_public_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$public-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_guest_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$all-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='port-index' value='0' />
+ </set>
+ <for silentFailure='true' index='vnfc-port-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_subintcount'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data_length`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v4`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_floating_ip'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v4`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v6`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_floating_v6_ip'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v6`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vlan-cdl' value='' />
+ <parameter name='net-names-cdl' value='' />
+ <parameter name='net-id-cdl' value='' />
+ <parameter name='ipv4-ips-cdl' value='' />
+ <parameter name='ipv6-ips-cdl' value='' />
+ </set>
+ <for silentFailure='true' index='vnic-sub-interface-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block>
+ <switch test='`$vlan-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vlan-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].vlan-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vlan-cdl' value="`$vlan-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].vlan-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$net-names-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='net-names-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='net-names-cdl' value="`$net-names-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$net-id-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='net-id-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='net-id-cdl' value="`$net-id-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='nii-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_ip_'
+ + $ip-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip[$ip-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_v6_ip_'
+ + $ip-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip[$ip-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <switch test='`$vlan-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_vlan_ids'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$vlan-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$net-names-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_net_names'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$net-names-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$net-id-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_net_ids'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$net-id-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='port-index' value='`$port-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='az-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`'availability_zone_'
+ + $az-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$az-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block>
+ <set>
+ <parameter name='network-key' value='' />
+ </set>
+ <set>
+ <parameter name='network-role' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ </set>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$network-role ==
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-key' value='`network-role`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`' />
+ </set>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-key`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$network-key`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_id'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].neutron-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_name'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].contrail-network-fqdn`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_fqdn'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].contrail-network-fqdn
+`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-ipv4' value='false' />
+ <parameter name='found-ipv6' value='false' />
+ </set>
+ <for silentFailure='true' index='subnet-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].ip-version`'>
+ <outcome value='ipv4'>
+ <switch test='`$found-ipv4`'>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + $const.subnet-id`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='found-ipv4' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='ipv6'>
+ <switch test='`$found-ipv6`'>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + $const.v6-subnet-id`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='found-ipv6' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.preload-parameters.' value='`$tmp.vf-module-topology.vf-module-parameters.`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.' value='`$tmp.vf-module-parameters.`' />
+ </set>
+ <for silentFailure='true' index='preload-index' start='0' end='`$tmp.preload-parameters.param_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='cur-index' start='0' end='`$output-index`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].name
+ == $tmp.preload-parameters.param[$preload-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].value' value='`$tmp.preload-parameters.param[$preload-index].value`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.preload-parameters.param[$preload-index].name`" />
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.preload-parameters.param[$preload-index].value`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='input-index' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='cur-index' start='0' end='`$output-index`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].name
+ == $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].value'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].value`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].name'
+ value="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].name`" />
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].value'
+ value="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].value`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param_length' value='`$output-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml new file mode 100755 index 0000000..edbbcca --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml @@ -0,0 +1,188 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-assign-rollback' mode='sync'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $vf-module-topology-operation-input.vf-module-information.vf-module-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag`'>
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" ></delete>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag`'>
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND related-to = l3-network
+ AND l3-network.network-id = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id" ></delete>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml new file mode 100755 index 0000000..d7f4ddd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml @@ -0,0 +1,196 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'activate' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="Active" />
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <update resource='SQL' force='true' plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ key='UPDATE EIPAM_IP_ASSIGNMENTS SET status = "ACTIVE" WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleactivate.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml new file mode 100644 index 0000000..923303a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml @@ -0,0 +1,1862 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign-async' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <set>
+ <parameter name="so.ack-final-indicator" value="Y" />
+ <parameter name="so.response-code" value="500" />
+ <parameter name="so.notification-url" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="so.svc-request-id" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="so.service-type" value="`$vf-module-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="so.service-instance-id" value="`$vf-module-topology-operation-input.service-information.service-instance-id`" />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' with error: ' + $error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VF module id ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id
+ + ' already exists, and status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.vf-module-level-oper-status.order-status`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-type' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='tmp.vf-module-topology.tenant' value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='tmp.vf-module-topology.aic-cloud-region' value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving cloud region from AAI. Is AAI down?" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'from-preload flag is true but could not find preload information for VF module name ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'from-preload flag is true but could not find preload information for VF module name ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='`$idx`' />
+ </set>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VNFC network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ + ' is not found in VNF network list'
+ `" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='af-count' value='0' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <set>
+ <parameter name='af-count' value='`$af-count + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$af-count`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$subnet-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='-1' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have network-start-address populated'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have cidr-mask populated'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='ip-type' value='IPv4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='ip-type' value='IPv6' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="isInSameSubnet">
+ <parameter name="firstIPAddr" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`" />
+ <parameter name="secondIPAddr" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address`" />
+ <parameter name="subnet" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`" />
+ <parameter name="ipType" value="`$ip-type`" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$subnet-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Not able to find VNF network subnet that contains address '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address
+ `" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id' value='`$subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodulec.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid
+ and network_role = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-message" value="Error reading VFC_RELATED_NETWORK_ROLE table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for index='db-related-network-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='related-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network[$related-network-index].network-role
+ == $db.vnf-related-network-role[$db-related-network-index].related-network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='true' />
+ </set>
+ <set>
+ <parameter name='saved-vnf-network-index' value='`$vnf-network-index`' />
+ <parameter name='saved-related-network-index' value='`$related-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-message" value="`'Unable to find related network '
+ + $db.vnf-related-network-role[$db-related-network-index].related-network-role + ' in vnf-networks'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].is-trunked'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].is-trunked`' />
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].segmentation-id`' />
+ </set>
+ <set>
+ <parameter name='rn-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.vlan-interface`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.lower-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.upper-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.is-private`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vf-module-name" value="`$tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="selflink" value="`$vf-module-object-path`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-function' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-function' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="cp-instance-id" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id" >
+ <parameter name="cp-instance-id" value="`$cp-instance-id`" />
+ <parameter name="port-id" value="0" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving cp object to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving cp object to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.connection-point-id'
+ value='`$cp-instance-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.port-id'
+ value='0' />
+ </set>
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating cp relationship to l3-network in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vlan-tag" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vlan-tags/vlan-tag/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.vlan-interface`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating cp relationship to l3-network and vlan-tag in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network and vlan-tag" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vf-module relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-generate-heat-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleheat.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <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="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_id, vm_name, cloud_region_id, cloud_owner) VALUES ( $service-data.vnfs.vnf[$vnf-index].vnf-id , $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name , $service-data.service-information.service-instance-id , $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index] , $tmp.vf-module-topology.aic-cloud-region , $prop.cloud-region.cloud-owner )" >
+ <outcome value='failure'>
+ <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="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.' value='tmp.vf-module-topology.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <set>
+ <parameter name='vf-module-data.'
+ value='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vf-module`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.service-topology.service-topology-identifier.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vf-module.url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'vf-module-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.controller.url + $tmp.vf-module.url`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="vf-module-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vf-module" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vf-module" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodule.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml new file mode 100755 index 0000000..fd1ca63 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml @@ -0,0 +1,1302 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign-no-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='false' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm_length'
+ value='`$db.vf-module-to-vfc-mapping_length`' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_MODEL WHERE customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No entries found in VFC_MODEL table for customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="$db.vfc-model.ecomp-generated-naming == 'Y'">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'ECOMP generated naming is not Y for VFC customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="$db.vfc-model.naming-policy">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'naming_policy is null for VFC customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code'
+ value='`$db.vfc-model.nfc-naming-code`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type-tag'
+ value='`$db.vfc-model.vm-type-tag`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ <!-- Context variables used when creating vnfc object in AAI -->
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ </set>
+ <for index='vm-index' start='0' end='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vfc-model.customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VM name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]'
+ value='`$naming-policy-generate-name-output.vm-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-to-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for index='network-role-index' start='0' end='`$db.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='idx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-role == $db.vfc-to-network-role-mapping[$network-role-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network found in MD-SAL with network-role ' + $db.vfc-to-network-role-mapping[$network-role-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <!--This isn't a node in MD-SAL, but we need to save this for later when we are doing EIPAM processing-->
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id'
+ value='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
+ </set>
+ <switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-information-index' value='-1' />
+ </set>
+ </outcome>
+ <outcome value='4'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-information-index' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
+ value='ipv4' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='6'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-information-index' value='`$network-information-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
+ value='ipv6' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$db.vfc-to-network-role-mapping_length`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='auto-ip-assignment-input.aic-cloud-region'
+ value='`$tmp.vf-module-topology.aic-cloud-region`' />
+ <parameter name='auto-ip-assignment-input.vf-module.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='auto-ip-assignment-input.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='auto-ip-assignment-input.service-instance-id'
+ value='`$service-data.service-information.service-instance-id`' />
+ <parameter name='auto-ip-assignment-input.service-type'
+ value='`$service-data.service-information.service-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-type'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' />
+ </set>
+ <for index='vm-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vm-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names[$vnfc-name-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name`' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='auto-ip-assignment-input.vnf-topology.vnf-assignments.'
+ value='tmp.vnf-topology.vnf-assignments.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='auto-ip-assignment' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure in call to auto-ip-assignment: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload.log' />
+ </execute>
+ <for silentFailure='true' index='plan-index' start='0' end='`$eipam-ip-block.plans_length`' >
+ <for silentFailure='true' index='req-index' start='0' end='`$eipam-ip-block.plans[$plan-index].requests_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='ck-split' />
+ <parameter name='original_string' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='regex' value='\|' />
+ </execute>
+ <set>
+ <parameter name='tmp.vm-type' value='`$ck-split[0]`' />
+ <parameter name='tmp.vnfc-name' value='`$ck-split[1]`' />
+ <parameter name='tmp.network-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[3]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[5]`' />
+ <parameter name='tmp.ip-type' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-type`' />
+ <parameter name='tmp.client-key' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='tmp.ip-prefix' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-prefix`' />
+ </set>
+ <switch test='`$tmp.subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $tmp.vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned vm-type ' + $tmp.vm-type + ' but could not find that under vf-module-assignments'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.ip-type`'>
+ <outcome value='FIXED'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='false' />
+ </set>
+ <for silentFailure='true' index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name
+ == $tmp.vnfc-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vnfc-name`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned VNFC name ' + $tmp.vnfc-name + ' but could not find that under vf-module-assignments for vm-type ' + $tmp.vm-type`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='false' />
+ </set>
+ <for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length'
+ value='`$network-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='false' />
+ </set>
+ <for index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.subnet-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-subnet-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length'
+ value='`$subnet-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.address-family`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='address-family-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length'
+ value='`$address-family-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ip-address-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].ip-type'
+ value='FIXED' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length'
+ value='`$ip-address-length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-role' value='`$ck-split[1]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[4]`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='6'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload2.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vnfc-subnet-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.ip-version'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.nii-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='nii-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$nii-index].ip-version
+ == $tmp.ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index' value='`$nii-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.nii-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='`$tmp.nii-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.ip-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='ip-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <block>
+ <set>
+ <parameter name='target-index' value='`$ip-index + $tmp.ip-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip[$target-index]'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-index].vnfc-ip-address`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-count'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload3.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml new file mode 100755 index 0000000..879f000 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml @@ -0,0 +1,559 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vf-module-topology.`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='db-vm-type-index' value='-1' />
+ </set>
+ <for index='tmp-idx' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
+ <switch test='`$db.vf-module-to-vfc-mapping[$tmp-idx].vm-type
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='db-vm-type-index' value='`$tmp-idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$db-vm-type-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Preload data contains vm-type ' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type + ' but VF_MODULE_TO_VFC_MAPPING table does not have this vm-type'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_MODEL WHERE customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_MODEL table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No entries found in VFC_MODEL table for customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code'
+ value='`$db.vfc-model.nfc-naming-code`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' />
+ </set>
+ <switch test='`$db.vfc-model.naming-policy`'>
+ <outcome value=''>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-type-index]`' />
+ </set>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='NA' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <for silentFailure='true' index='ip-version-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-dhcp'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ip-count'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-count`' />
+ </set>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].vnfc-ip-address'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip[$ip-index]`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].ip-type'
+ value='FIXED' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload-x.log' />
+ </execute>
+ <for silentFailure='true' index='vnf-network-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='false' />
+ </set>
+ <for silentFailure='true' index='ex-vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-name`'>
+ <outcome value='true'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='0' />
+ </set>
+ <switch test="`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[0].sdnc-subnet-id`">
+ <outcome value=''>
+ <block atomic="true">
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='subnet-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='false' />
+ </set>
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].ip-version
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='match' value='true' />
+ </set>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$match`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-match`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preloadxxx.log' />
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find subnet match for network-name '
+ + $mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='`$cur-subnet-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$cur-subnet-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-id for network with network-role ' + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml new file mode 100644 index 0000000..5260147 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml @@ -0,0 +1,1433 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign-sync' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VF module id ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id
+ + ' already exists, and status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.vf-module-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-type' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='tmp.vf-module-topology.tenant' value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='tmp.vf-module-topology.aic-cloud-region' value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='`$idx`' />
+ </set>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNFC network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ + ' is not found in VNF network list'
+ `" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='af-count' value='0' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <set>
+ <parameter name='af-count' value='`$af-count + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$af-count`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$subnet-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='-1' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`'>
+ <outcome value=''>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have network-start-address populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`'>
+ <outcome value=''>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have cidr-mask populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='ip-type' value='IPv4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='ip-type' value='IPv6' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="isInSameSubnet">
+ <parameter name="firstIPAddr" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`" />
+ <parameter name="secondIPAddr" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address`" />
+ <parameter name="subnet" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`" />
+ <parameter name="ipType" value="`$ip-type`" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$subnet-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Not able to find VNF network subnet that contains address '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address
+ `" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id' value='`$subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodulec.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid
+ and network_role = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for index='db-related-network-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='related-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network[$related-network-index].network-role
+ == $db.vnf-related-network-role[$db-related-network-index].related-network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='true' />
+ </set>
+ <set>
+ <parameter name='saved-vnf-network-index' value='`$vnf-network-index`' />
+ <parameter name='saved-related-network-index' value='`$related-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='false'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find related network '
+ + $db.vnf-related-network-role[$db-related-network-index].related-network-role + ' in vnf-networks'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].is-trunked'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].is-trunked`' />
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].segmentation-id`' />
+ </set>
+ <set>
+ <parameter name='rn-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.vlan-interface`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.lower-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.upper-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.is-private`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vf-module-name" value="`$tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="selflink" value="`$vf-module-object-path`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-function' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-function' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="cp-instance-id" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id" >
+ <parameter name="cp-instance-id" value="`$cp-instance-id`" />
+ <parameter name="port-id" value="0" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating cp object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating cp object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.connection-point-id'
+ value='`$cp-instance-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.port-id'
+ value='0' />
+ </set>
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating cp relationship to l3-network in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vlan-tag" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vlan-tags/vlan-tag/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.vlan-interface`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating cp relationship to l3-network and vlan-tag in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network and vlan-tag" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-generate-heat-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleheat.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <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="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_id, vm_name, cloud_region_id, cloud_owner) VALUES ( $service-data.vnfs.vnf[$vnf-index].vnf-id , $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name , $service-data.service-information.service-instance-id , $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index] , $tmp.vf-module-topology.aic-cloud-region , $prop.cloud-region.cloud-owner )" >
+ <outcome value='failure'>
+ <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="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.' value='tmp.vf-module-topology.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='gw-vfmodule-update' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodule.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml new file mode 100755 index 0000000..f1f9ca1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml @@ -0,0 +1,27 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`length($vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == $prop.so.ignore-url'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml new file mode 100644 index 0000000..e0527fb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml @@ -0,0 +1,28 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml new file mode 100755 index 0000000..93eaf71 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml @@ -0,0 +1,158 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'changeassign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vfmodule-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error performing changeassign for self-serve vf-module resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.onap-model-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.onap-model-information.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml new file mode 100755 index 0000000..788f0a9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml @@ -0,0 +1,177 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-topology.vf-module-assignments.vf-module-status' value='PendingDelete' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingDelete' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml new file mode 100755 index 0000000..4586dad --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml @@ -0,0 +1,386 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve vf-moldule esources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <block>
+ <set>
+ <parameter name="tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx].' value='' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
+ </set>
+ </block>
+ </for>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating EIPAM_IP_ASSIGNMENTS table" />
+ </return>
+ </outcome>
+ </update>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='service-data.service-information.service-type' value='`$service-data.service-information.subscription-service-type`' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in EIPAM unassign IP address" />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <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="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ </block>
+ </for>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='success'>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $aai.instance-group.instance-group[$ig-index].id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $aai.instance-group.instance-group[$ig-index].id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$aai.instance-group.instance-group[$ig-index].id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-name`'>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.name-table-type' value='VF_MODULE_INSTANCE' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-name-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vnfc-index]`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"></delete>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" ></delete>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" ></delete>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <block>
+ <set>
+ <parameter name="tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx].' value='' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
+ </set>
+ </block>
+ </for>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml new file mode 100644 index 0000000..fa9cbd9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml @@ -0,0 +1,197 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vf-module-input' mode='sync' ></call>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`length($vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url == $prop.so.ignore-url`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <set>
+ <parameter name='ack-final' value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="request-action"/>
+ <parameter name="field3" value='`$vf-module-topology-operation-input.request-information.request-action`'/>
+ </record>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='SdwanBandwidthChange'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-bandwidth-policy-change' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml new file mode 100755 index 0000000..42c29a7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml @@ -0,0 +1,313 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-vlan-tagging-activate' mode='sync'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $vf-module-topology-operation-input.vnf-information.vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.aai.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='vsig-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vsig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vsig-index`'>
+ <outcome value='-1'>
+ <block>
+ <set>
+ <parameter name='vsig-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role'
+ value='`$parent-port-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function'
+ value='`$vnfc-instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function'
+ value='`$network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='`$vsig-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $prop.cloud-region.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-name' value='`$tmp.aai.network.results[0].l3-network.network-name`' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='dest-vnfc-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' />
+ </set>
+ <for index='src-vnfc-index' start='0'
+ end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnfc-name'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.interfaces">
+ <parameter name="start[0]" value="`'/network/vnfcs/vnfc/' + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/vserver-l-interfaces-fromVnfc?networkName=' + $network-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get interface data for network name '
+ + $network-name
+ + ' and vnfc '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for silentFailure='true' index='idx1' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-name`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic_length'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' />
+ </set>
+ <for silentFailure='true' index='int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx2' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface_length'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='sub-int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-id'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-name'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx3' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`'>
+ <outcome value='true'>
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='idx4' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-interface
+ == $tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.upper-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.lower-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='dest-vnfc-index' value='`$dest-vnfc-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$dest-vnfc-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml new file mode 100755 index 0000000..f451812 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml @@ -0,0 +1,791 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-vlan-tagging-assign' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select distinct vmvm.vm_type, rg.group_uuid from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_MODEL vm,
+ RESOURCE_GROUP_TO_TARGET_NODE_MAPPING rgm, RESOURCE_GROUP rg
+ where vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmvm.vfc_customization_uuid = vm.customization_uuid
+ and vmvm.vm_type = vm.vm_type
+ and vm.uuid = rgm.target_node_uuid
+ and rgm.target_type = 'CVFC'
+ and rgm.group_uuid = rg.group_uuid"
+ pfx='db.group-uuids[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting group uuids from DB" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='group-index' start='0' end='`$db.group-uuids_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_name, attribute_value from ATTRIBUTE_VALUE_PAIR
+ where resource_uuid = $db.group-uuids[$group-index].group-uuid
+ and attribute_name in ('vfc_instance_group_function','vfc_parent_port_role','network_collection_function')"
+ pfx='db.parameters[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting parameters from ATTRIBUTE_VALUE_PAIR table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find parameters ATTRIBUTE_VALUE_PAIR table for group ' + $db.group-uuids[$group-index].group-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for index='parameter-index' start='0' end='`$db.parameters_length`' >
+ <switch test='`$db.parameters[$parameter-index].attribute-name`'>
+ <outcome value='vfc_parent_port_role'>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc_parent_port_role' value='`$db.parameters[$parameter-index].attribute-value`' />
+ </set>
+ </outcome>
+ <outcome value='vfc_instance_group_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc-instance-group-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='network_collection_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].network-collection-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].vfc-instance-group-function
+ AND instance-group.instance-group-type = 'VNFC'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vvig-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <break/>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vvig-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ == $aai.instance-group.instance-group[$aai-ig-index].id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Instance group id '
+ + $aai.instance-group.instance-group[$aai-ig-index].id
+ + ' already exists in MD-SAL under vlan-vnfc-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='vvig-index' value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function'
+ value='`$db.group-uuids[$group-index].vfc-instance-group-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length'
+ value='`$vvig-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $db.group-uuids[$group-index].vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'TOSCA provided vm-type ' +
+ $db.group-uuids[$group-index].vm-type + ' but that was not found in vf-module-assignments.vms'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group:relationship-list"
+ key="instance-group.id = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/' +
+ $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error creating instance-group relationship to vnfc" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Not-found error relating instance group '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ + ' to vnfc '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].data-created' value='true' />
+ </set>
+ </block>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select property_name from VF_MODULE_TO_VFC_MAPPING vmvm,
+ RESOURCE_POLICY_TO_TARGET_NODE_MAPPING rptnm, RESOURCE_POLICY rp
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = rptnm.target_node_uuid
+ AND rptnm.policy_uuid = rp.policy_uuid
+ AND rp.property_type = 'vlan_tag_policy'
+ AND rp.policy_type = 'ecomp.policies.External'
+ AND rp.property_source = 'Policy Manager'"
+ pfx='db.policy[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure retrieving policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role'
+ value='`$db.group-uuids[$group-index].vfc_parent_port_role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-assignment-policy-name'
+ value='`$db.policy[0].property-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function'
+ value='`$db.group-uuids[$group-index].network-collection-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group_length'
+ value='1' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select vnrm.* from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_TO_NETWORK_ROLE_MAPPING vnrm
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = vnrm.vfc_customization_uuid
+ AND vnrm.network_role_tag = $db.group-uuids[$group-index].vfc_parent_port_role"
+ pfx='db.vfc-to-network-role[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure reading VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find rows in VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='vnic-index' start='0' end='`$db.vfc-to-network-role_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id'
+ value='`$vnic-index`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic_length'
+ value='`$db.vfc-to-network-role_length`' />
+ </set>
+ <set>
+ <parameter name='get-data-from-policy-input.policy-instance-name' value='`$db.policy[0].property-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$get-data-from-policy-output.precreate-sub-intf-num > 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='assign-vlan-tags' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for index='vnfc-index' start='1' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnics-groups.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnics-groups.`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='counter' value='0' />
+ </set>
+ <set>
+ <parameter name='seq-no' value='1' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='FIXED' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vt-ip.network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <switch test='`$get-data-from-policy-output.ip-assignment`'>
+ <outcome value='shared'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value="`'/var/tmp/bgb-eipam.log' + $counter`" />
+ </execute>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='unique'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ </set>
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'From policy: ip-assignment is '
+ + $get-data-from-policy-output.ip-assignment
+ + ' but must be unique or shared'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vm-vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <for index='vnic-group-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='-1' />
+ </set>
+ <for index='vn-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='`$vn-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnfc-network for network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role.vnfc-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <for index='vnic-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='v-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$v-index].vnfc-port-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='`$v-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-port-index`'>
+ <outcome value='-1'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnfc-port-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vnfc-port-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnfc-port-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length'
+ value='`$vnfc-port-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml new file mode 100755 index 0000000..b39e116 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml @@ -0,0 +1,88 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-vlan-tagging-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <for index='vnfc-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ </set>
+ <for silentFailure='true' index='vsig-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Cannot deactivate module because customer bonding request exists' />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnf-vnfc-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$vnf-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <block>
+ <for index='$idx' start='`$vnf-vnfc-index`'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx + 1].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length].' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml new file mode 100644 index 0000000..9a7a73b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml @@ -0,0 +1,289 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync'>
+ <block atomic="true">
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='type is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.network-instance-group-function`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-instance-group-function is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='ip-version is required' />
+ </return>
+ </outcome>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.address-family' value='4' />
+ <parameter name='tmp.sql.address-family' value='%4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.address-family' value='6' />
+ <parameter name='tmp.sql.address-family' value='%6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.' value='' />
+ </set>
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value='FIXED'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.vnfc-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnfc-name is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.vf-module-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vf-module-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.sequence-number`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='seq-num is required' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.selected-client-key"
+ value="`$tmp.vt-ip.vm-type + '|' +
+ $tmp.vt-ip.vnfc-name + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.address-family + '|' +
+ $tmp.vt-ip.sequence-number`" />
+ <!--
+fixed-ip client-key:
+vm-type + VFCname + network-instance-group-function + "FIXED" + [ip-version(4/6)] + seqNo
+ seqNo required for unique, but not required for shared
+-->
+ </set>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.vf-module-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.nf-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='nf-role is required for VIP ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-isntance-group-id is required for VIP' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ <set>
+ <parameter name='tmp.selected-client-key'
+ value="`$tmp.vt-ip.nf-role + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.vt-ip.ip-version`" />
+ <!--
+loating-ip client-key:
+nf-role + network-instance-group-function + "VIP" + [ip-version(4/6)]
+-->
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id == '' and $tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='either network-id or network-isntance-group-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_id = ' +
+ '$tmp.vt-ip.network-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-id = ' + $tmp.vt-ip.network-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-id"
+ value="`$tmp.vt-ip.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$tmp.vt-ip.network-instance-group-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_instance_group_id = '+
+ '$tmp.vt-ip.network-instance-group-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-instance-group-id = ' + $tmp.vt-ip.network-instance-group-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-instance-group-id"
+ value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.level4-key-found' value='false' />
+ </set>
+ <for index='didx' start='0' end='`$db.selected-subnet-data_length`' >
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT a.entity_id, a.key_name, a.key_value, a.level from EIPAM_IP_SUBNET_KEYS a where level = (SELECT MAX(level) from EIPAM_IP_SUBNET_KEYS b where b.entity_id = a.entity_id and entity_id = ' + ' $db.selected-subnet-data[$didx].entity-id )'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-keys'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table to find MAX level by entity_id' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$db.selected-subnet-keys.level == '4' `">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.level4-key-found' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-entity-id' value='`$db.selected-subnet-keys.entity-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-plan-name' value='`$db.selected-subnet-data[$didx].plan-name`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </for>
+ <switch test="`$tmp.level4-key-found`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='No level 4 KeyName found in EIPAM_IP_SUBNET_KEYS' />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_SUBNET_KEYS
+ where entity_id = $tmp.selected-entity-id order by level'
+ pfx='db.eipam-subnet-keys[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table by entity_id' />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='key' start='0' end='`$db.eipam-subnet-keys_length`' >
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-name"
+ value="`$db.eipam-subnet-keys[$key].key-name`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-value"
+ value="`$db.eipam-subnet-keys[$key].key-value`"/>
+ </set>
+ </for>
+ <set>
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='`$tmp.selected-plan-name`' />
+ <parameter name='eipam-ip-block.plans[0].address-family' value="`$tmp.vt-ip.ip-version`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value="`$tmp.selected-client-key`" />
+ <parameter name="eipam-ip-block.plans[0].requests[0].info"
+ value="`$tmp.eipam.info`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools_length" value="4"/>
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name="eipam-ip-block.plans_length" value="1"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/vlan-tag-ip.log' />
+ </execute>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while obtaining ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml new file mode 100644 index 0000000..d602cc0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml @@ -0,0 +1,242 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-get-resource-request' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-id" value='`$vnf-get-resource-request-input.service-information.service-instance-id`'/>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-name" value='`$service-data.service-topology.service-topology-identifier.service-instance-name`'/>
+ </set>
+ <switch test="`$vnf-get-resource-request-input.vnf_length == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length" value='`$service-data.vnfs.vnf_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`'/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf_counter" value='0'/>
+ </set>
+ <for index='ll' start='0' end='`$vnf-get-resource-request-input.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf-id" value="`$vnf-get-resource-request-input.vnf[$ll].vnf-id`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vnf-id == $service-data.vnfs.vnf[$i].vnf-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name="tmp.pnum" value='0'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='tmp.prnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key_length`' value='`$tmp.prnum + 1`' />
+ <parameter name='tmp.prnum' value='`$tmp.prnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param_length`' value='`$tmp.pnum + 1`' />
+ <parameter name='tmp.pnum' value='`$tmp.pnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='ln' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <switch test="`$vnf-get-resource-request-input.vnf[$ll].vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='jj' start='0' end='`$vnf-get-resource-request-input.vnf[$ll].vf-module_length`' >
+ <switch test='`$vnf-get-resource-request-input.vnf[$ll].vf-module[$jj].vf-module-id == $service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length' value='`$tmp.vnf_counter + 1`' />
+ <parameter name='tmp.vnf_counter' value='`$tmp.vnf_counter + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <return status="success">
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml new file mode 100755 index 0000000..6d5aacd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml @@ -0,0 +1,84 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'activate' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml new file mode 100644 index 0000000..61b4226 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml @@ -0,0 +1,1536 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-assign-async' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <set>
+ <parameter name="so.ack-final-indicator" value="Y" />
+ <parameter name="so.response-code" value="500" />
+ <parameter name="so.notification-url" value="`$vnf-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="so.svc-request-id" value="`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="so.service-type" value="`$vnf-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="so.service-instance-id" value="`$vnf-topology-operation-input.service-information.service-instance-id`" />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVnfInstance'" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id + ' with error: ' + $error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='0' />
+ </set>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Cannot find instance group id ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in AAI'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving instance-group from AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='rel-index' start='0' end='`$aai.instance-group.relationship-list.relationship_length`' >
+ <switch test='`$aai.instance-group.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='collection'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value"
+ pfx='aai.collection' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find AAI relationship from collection '
+ + $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value
+ + ' to service instance'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to get network service instance '
+ + $network-service-instance + ' from MD-SAL'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Could not find network instance group ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in MD-SAL service instance '
+ + $network-service-instance`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-function'
+ value='`$aai.instance-group.instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-id'
+ value='`$aai.instance-group.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-service-instance-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].service-instance-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-customization-uuid'
+ value='`$aai.collection.collection-customization-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='`$tmp.vnf-network-collection_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length'
+ value='`$tmp.vnf-network-collection_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.vf-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$db.vf-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='vnf_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='VNF_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vf-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to generate VNF name" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$naming-policy-generate-name-output.vnf-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vnf-name' value="`$vnf-topology-operation-input.vnf-information.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
+ value='`$tmp.vnf-name`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
+ depth='all'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_TO_NETWORK_ROLE_MAPPING WHERE vf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_TO_NETWORK_ROLE_MAPPING table" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='0' />
+ </set>
+ <for silentFailure='true' index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <switch test='`$db.vf-network-role-mapping[$role-index].network-role`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='null'>
+ <block></block>
+ </outcome>
+ <outcome value='NULL'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='aai.l3-network.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $db.vf-network-role-mapping[$role-index].network-role"
+ pfx='aai.l3-network' local-only='false'
+>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving l3-network from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='l3-network-id' value='-1' />
+ </set>
+ <block>
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Create'>
+ <block></block>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Delete'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <set>
+ <parameter name='network-service-instance-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='cloud-region'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$l3-network-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
+ value='`$db.vf-network-role-mapping[$role-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].neutron-network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
+ value='`$aai.l3-network.l3-network[$db-network-index].contrail-network-fqdn`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' >
+ <block>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
+ value='`$tmp.ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].neutron-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].sdnc-subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-role'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].network-start-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].network-start-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].gateway-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].gateway-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].cidr-mask'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].cidr-mask`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].dhcp-enabled`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='Y' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='N' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ and network_role = $db.vf-network-role-mapping[$role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VNF_RELATED_NETWORK_ROLE table" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-topology-identifier-structure`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$network-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.ntis-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$l3-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ntis-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ntis" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`
+ 'Error retrieving network-topology-identifier-structure for service instance '
+ + $network-service-instance-id
+ + ' and network-id '
+ + $l3-network-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].is-trunked'
+ value='`$mdsal-ntis.network-topology-identifier-structure.is-trunked`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].segmentation-id'
+ value='`$mdsal-ntis.network-topology-identifier-structure.segmentation-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $network-service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error getting owning entity from service instance" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find owning entity from service instance" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='rn-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='rel-network-role-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.get-networks">
+ <parameter name="start[0]" value="`'/business/owning-entities/owning-entity/' + $tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/getNetworks?networkRole=' + $db.vnf-related-network-role[$rel-network-role-index].related-network-role
+ + '&cloudRegionId=' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error calling getNetworks custom query in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No l3-network returned from getNetworks custom query for related network role '
+ + $db.vnf-related-network-role[0].related-network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-id'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-role'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-role`' />
+ </set>
+ <for index='rel-index' start='0' end='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='vlan-tag'>
+ <block atomic="true">
+ <set>
+ <parameter name='vlan-tag-id' value='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $vlan-tag-id"
+ pfx='aai.vlan-tag' local-only='false'
+>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error getting vlan-tag object from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$aai.vlan-tag.vlan-tag-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$aai.vlan-tag.vlan-id-outer`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$aai.vlan-tag.vlan-id-inner`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$aai.vlan-tag.is-private`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnfa.log' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$network-index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <switch test='`$aai.cloud-region.availability-zones.availability-zone_length`'>
+ <outcome value=''>
+ <switch test='`$db.vf-model.avail-zone-max-count > 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='aai.cloud-region.availability-zones.availability-zone_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$aai.cloud-region.availability-zones.availability-zone_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
+ value='`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <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="`$prop.cloud-region.cloud-owner`" />
+ <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="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
+ value='`$db.vf-model.avail-zone-max-count`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
+ value='`$aai.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <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.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <!-- <parameter name="operational-status" value="out-of-service-path" /> -->
+ <parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
+ <parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="selflink" value="`$vnf-object-path`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating selflink in generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-information.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/instance-groups/instance-group/'
+ + $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating relationship in generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-assign`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.service-topology.service-topology-identifier.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vnf.url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <set>
+ <parameter name='vnf-data.' value='service-data.vnfs.vnf[$vnf-index].vnf-data.' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'vnf-data-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.controller.url + $tmp.vnf.url`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="vnf-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vnf-data" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vnf-data" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnf.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml new file mode 100644 index 0000000..2202dac --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml @@ -0,0 +1,1250 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-assign-sync' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='0' />
+ </set>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find instance group id ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving instance-group from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='rel-index' start='0' end='`$aai.instance-group.relationship-list.relationship_length`' >
+ <switch test='`$aai.instance-group.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='collection'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value"
+ pfx='aai.collection' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find collection ' +
+ $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value
+ + ' in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error retrieving collection from AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find network instance group ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-function'
+ value='`$aai.instance-group.instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-id'
+ value='`$aai.instance-group.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-service-instance-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].service-instance-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-customization-uuid'
+ value='`$aai.collection.collection-customization-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='`$tmp.vnf-network-collection_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length'
+ value='`$tmp.vnf-network-collection_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.vf-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.vf-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='vnf_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='VNF_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vf-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to generate VNF name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$naming-policy-generate-name-output.vnf-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vnf-name' value="`$vnf-topology-operation-input.vnf-information.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
+ value='`$tmp.vnf-name`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
+ depth='all'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli`'>
+ <outcome value=''>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_TO_NETWORK_ROLE_MAPPING WHERE vf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='0' />
+ </set>
+ <for silentFailure='true' index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <switch test='`$db.vf-network-role-mapping[$role-index].network-role`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='null'>
+ <block></block>
+ </outcome>
+ <outcome value='NULL'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='aai.l3-network.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $db.vf-network-role-mapping[$role-index].network-role"
+ pfx='aai.l3-network' local-only='false'
+>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No active l3-network found in AAI with cloud_region_id '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + ' and network_role '
+ + $db.vf-network-role-mapping[$network-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving l3-network from AAI" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='l3-network-id' value='-1' />
+ </set>
+ <block>
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Create'>
+ <block></block>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Delete'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <set>
+ <parameter name='network-service-instance-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='cloud-region'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$l3-network-id`'>
+ <outcome value='-1'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
+ value='`$db.vf-network-role-mapping[$role-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].neutron-network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
+ value='`$aai.l3-network.l3-network[$db-network-index].contrail-network-fqdn`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' >
+ <block>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
+ value='`$tmp.ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].neutron-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].sdnc-subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-role'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].network-start-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].network-start-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].gateway-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].gateway-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].cidr-mask'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].cidr-mask`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].dhcp-enabled`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='Y' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='N' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ and network_role = $db.vf-network-role-mapping[$role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VNF_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-topology-identifier-structure`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$network-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.ntis-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$l3-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ntis-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ntis" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`
+ 'Error retrieving network-topology-identifier-structure for service instance '
+ + $network-service-instance-id
+ + ' and network-id '
+ + $l3-network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].is-trunked'
+ value='`$mdsal-ntis.network-topology-identifier-structure.is-trunked`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].segmentation-id'
+ value='`$mdsal-ntis.network-topology-identifier-structure.segmentation-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $network-service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting owning entity from service instance" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to find owning entity from service instance" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='rn-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='rel-network-role-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.get-networks">
+ <parameter name="start[0]" value="`'/business/owning-entities/owning-entity/' + $tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/getNetworks?networkRole=' + $db.vnf-related-network-role[$rel-network-role-index].related-network-role
+ + '&cloudRegionId=' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error calling getNetworks custom query in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network returned from getNetworks custom query for related network role '
+ + $db.vnf-related-network-role[0].related-network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-id'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-role'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-role`' />
+ </set>
+ <for index='rel-index' start='0' end='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='vlan-tag'>
+ <block atomic="true">
+ <set>
+ <parameter name='vlan-tag-id' value='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $vlan-tag-id"
+ pfx='aai.vlan-tag' local-only='false'
+>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting vlan-tag object from AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$aai.vlan-tag.vlan-tag-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$aai.vlan-tag.vlan-id-outer`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$aai.vlan-tag.vlan-id-inner`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$aai.vlan-tag.is-private`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnfa.log' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$network-index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <switch test='`$aai.cloud-region.availability-zones.availability-zone_length`'>
+ <outcome value=''>
+ <switch test='`$db.vf-model.avail-zone-max-count > 0`'>
+ <outcome value='true'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='aai.cloud-region.availability-zones.availability-zone_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$aai.cloud-region.availability-zones.availability-zone_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
+ value='`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <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="`$prop.cloud-region.cloud-owner`" />
+ <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="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
+ value='`$db.vf-model.avail-zone-max-count`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
+ value='`$aai.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <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.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <!-- <parameter name="operational-status" value="out-of-service-path" /> -->
+ <parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
+ <parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="selflink" value="`$vnf-object-path`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating selflink in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-information.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/instance-groups/instance-group/'
+ + $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating relationship in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnf.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml new file mode 100755 index 0000000..9c6089f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml @@ -0,0 +1,27 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-assign' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`length($vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='$vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == $prop.so.ignore-url'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml new file mode 100644 index 0000000..64183eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml @@ -0,0 +1,28 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml new file mode 100755 index 0000000..a45713f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml @@ -0,0 +1,132 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'changeassign' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error performing changeassign for self-serve resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml new file mode 100755 index 0000000..7665486 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml @@ -0,0 +1,84 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml new file mode 100644 index 0000000..32e922e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml @@ -0,0 +1,174 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`' >
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`">
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cannot delete the VNF because there are VF modules defined" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="Error reading VF_MODEL table"/>
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'No model found for VNF customization UUID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`"/>
+ </record>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml new file mode 100644 index 0000000..9b8f9a0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml @@ -0,0 +1,253 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' ></call>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`length($vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-notification-url == $prop.so.ignore-url`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <set>
+ <parameter name='ack-final' value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ActivateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ActivateSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-create-huawei' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='CreateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='CreateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='CreateSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='DeleteSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeleteSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeleteSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='ChangeInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml new file mode 100644 index 0000000..b11e740 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml @@ -0,0 +1,777 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-activate" mode="sync"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </outcome> + <outcome value="false"> + <block atomic="true"> + <block atomic="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$pidx].network-data.network-information.onap-model-information.model-name == $network-topology-operation-input.network-information.onap-model-information.model-name`"> + <outcome value="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </outcome> + </switch> + </for> + </block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sotn"/> + <outcome value="true"> + <block> + <block atomic="true"> + <set> + <parameter name="sotnFcPortListLength" value="0"/> + </set> + <for index="sIdx" start="0" end="`$service-data.networks.network_length`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sotn"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.sotnFcPortList[`$sotnFcPortListLength`]" value="`$sIdx`"/> + </set> + <for index="paramIdx" start="0" end="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param_length`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param[$paramIdx].name`"/> + <parameter name="target" value="address"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="sotnFcPortAddress" value="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param[$paramIdx].value`"/> + </set> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.oss.url + '/oss/inventory?location=' + $sotnFcPortAddress`"/> + <parameter name="format" value="json"/> + <parameter name="customHttpHeaders" value="X-FromAppId=MSO"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="temp.oss.accessTPs"/> + <outcome value="success"> + <switch test="`$temp.oss.accessTPs_length`"> + <outcome value="Other"> + <block atomic="true"> + <switch test="`$temp.accessTPs_length`"> + <outcome value=""> + <set> + <parameter name="tp_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="tp_length" value="`$temp.accessTPs_length`"/> + </set> + </outcome> + </switch> + <for index="idx" start="0" end="`$temp.oss.accessTPs_length`"> + <set> + <parameter name="`temp.accessTPs[$idx + $tp_length].`" value="`$temp.oss.accessTPs[$idx].`"/> + </set> + </for> + <set> + <parameter name="temp.accessTPs_length" value="`$temp.accessTPs_length + $temp.oss.accessTPs_length`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + </block> + </outcome> + </execute> + </for> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + <switch test="`$temp.accessTPs_length >= 2`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="prop.connection-attachment.access-topology-id" value="`$temp.accessTPs[0].access-topology-id`"/> + <parameter name="prop.connection-attachment.access-client-id" value="`$temp.accessTPs[0].access-client-id`"/> + <parameter name="prop.connection-attachment.access-provider-id" value="`$temp.accessTPs[0].access-provider-id`"/> + <parameter name="prop.connection-attachment.access-node-id" value="`$temp.accessTPs[0].access-node-id`"/> + <parameter name="prop.connection-attachment.access-ltp-id" value="`$temp.accessTPs[0].access-ltp-id`"/> + <parameter name="prop.remote.connection-attachment.access-topology-id" value="`$temp.accessTPs[1].access-topology-id`"/> + <parameter name="prop.remote.connection-attachment.access-client-id" value="`$temp.accessTPs[1].access-client-id`"/> + <parameter name="prop.remote.connection-attachment.access-provider-id" value="`$temp.accessTPs[1].access-provider-id`"/> + <parameter name="prop.remote.connection-attachment.access-node-id" value="`$temp.accessTPs[1].access-node-id`"/> + <parameter name="prop.remote.connection-attachment.access-ltp-id" value="`$temp.accessTPs[1].access-ltp-id`"/> + </set> + <for index="paidx" start="0" end="`$tmp.network-input-parameters.param_length`"> + <block> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'name'`"> + <outcome value="true"> + <set> + <parameter name="template.name" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'service-type'`"> + <outcome value="true"> + <set> + <parameter name="template.service-type" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'total-size'`"> + <outcome value="true"> + <set> + <parameter name="template.total-size" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'pir'`"> + <outcome value="true"> + <set> + <parameter name="template.pir" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'cbs'`"> + <outcome value="true"> + <set> + <parameter name="template.cbs" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'pbs'`"> + <outcome value="true"> + <set> + <parameter name="template.pbs" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'couplingFlag'`"> + <outcome value="true"> + <set> + <parameter name="template.couplingFlag" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'colorAware'`"> + <outcome value="true"> + <set> + <parameter name="template.colorAware" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'route-objective-function'`"> + <outcome value="true"> + <set> + <parameter name="template.route-objective-function" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'diversity-policy'`"> + <outcome value="true"> + <set> + <parameter name="template.diversity-policy" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.oof-getpath.templatefile`"/> + <parameter name="restapiUrl" value="`$prop.restapi.connection-oof-url`"/> + <parameter name="restapiUser" value="`$prop.oof.user`"/> + <parameter name="restapiPassword" value="`$prop.oof.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="oof"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`"/> + <outcome value="failure"></outcome> + <outcome value="success"> + <for index="vidx" start="0" end="`$oof.vpns_length`"> + <block atomic="true"> + <set> + <parameter name="oof.vpn." value="`$oof.vpns[$vidx].`"/> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $oof.vpn.access-node-id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false"> + <outcome value="success"> + <set> + <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`"/> + </set> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`"/> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`"/> + </return> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`"/> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`"/> + </return> + </outcome> + </get-resource> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sotn-api-ConnectivityService.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/operations/ZTE-API-ConnectivityService:create-connectivity-service'`"/> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`"/> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="patch"/> + <parameter name="responsePrefix" value="vpn-result"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`"/> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Error executing Create vpn rest api"/> + </return> + </outcome> + <outcome value="success"> + <block atomic="true"/> + </outcome> + </execute> + </block> + </for> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`"/> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`"/> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sitewan"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`"/> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + <outcome value="false"> + <block> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="false"> + <block> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </block> + </outcome> + </execute> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml new file mode 100644 index 0000000..d3b24d4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml @@ -0,0 +1,297 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-create" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="network-topology-operation-input.network-information.network-id"/> + <outcome value="failure"> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + </execute> + </outcome> + <outcome value="Other"></outcome> + </switch> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + </set> + </outcome> + </switch> + <set> + <parameter name="service-data.networks.network[$nidx].network-id" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`"/> + <parameter name="service-data.networks.network_length" value="`$nidx+1`"/> + </set> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml new file mode 100644 index 0000000..592fb65 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-deactivate" mode="sync"> + <block atomic="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace"> + <parameter name="source" value="`$prop.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.services-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$network-topology-operation-input.service-information.service-id`"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.controller.url + $tmp.services-url`"/> + <parameter name="restapiUser" value="`$prop.controller.user`"/> + <parameter name="restapiPassword" value="`$prop.controller.pwd`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="mdsal-psd"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Parent service data not available"/> + </return> + </outcome> + </execute> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$mdsal-psd.service-data.networks.network_length`"> + <switch test="`$mdsal-psd.service-data.networks.network[$pidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$mdsal-psd.service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$mdsal-psd.service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </block> + </outcome> + </switch> + </for> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + <parameter name="tmp.actualId-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUser'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUser" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUser-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiPassword'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiPassword" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiPassword-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'actualId'`"> + <outcome value="true"> + <set> + <parameter name="tmp.actualId" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.actualId-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiUser-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUser not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiPassword-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiPassword not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.actualId-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Wan Connection actualId not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$tmp.restapiUrl + $tmp.actualId`"/> + <parameter name="restapiUser" value="`$tmp.restapiUser`"/> + <parameter name="restapiPassword" value="`$tmp.restapiPassword`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="delete"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml new file mode 100644 index 0000000..9c24e52 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-delete" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + <outcome value="Other"></outcome> + </switch> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> 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 diff --git a/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml new file mode 100755 index 0000000..c1ed57c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml @@ -0,0 +1,626 @@ +<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='subnet-allocated-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="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <!--Need to know which ipv version to get the plan name from the network-model.--> + <switch test="`$eipam-ip-block.ptnii-name`"> + <!--If there's ptnii-name, then it's Gamma service--> + <outcome value='Other'> + <block> + <configure adaptor="com.att.sdnctl.sli.adaptor.ncs.ncsAdaptor" key="SNIIR" activate="true"> + <parameter name="input.request-id" value="`$eipam-ip-block.request-id`" /> + <parameter name="input.source" value="SDNC" /> + <parameter name="input.ptnii-name" value="`$eipam-ip-block.ptnii-name`" /> + <parameter name="input.ip-address" value="`$eipam-ip-block.ip-address`" /> + <parameter name="input.mask" value="`$eipam-ip-block.prefix-length`" /> + <outcome value="success"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'PENDING-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="PENDING-ACTIVE" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" /> + </save> + <return status="success"></return> + </block> + </outcome> + <outcome value="Other"> + <!--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="1000" /> + <parameter name="error-message" value="IpBlockInstall failure and deletePool deleted 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 = 'ERROR', + dealloc_failure = 'deletePool failed in response to NCS_IP_SUBNET_INSTALL_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="NCS_IP_SUBNET_INSTALL_ERROR" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool.vpe-id" pfx="vpe-after"> + <parameter name="operational-status" value="NCS_IP_SUBNET_INSTALL_ERROR" /> + <parameter name="summary-status" value="`$aai-summary-status-message`" /> + <parameter name="prov-status" value="PREPROV" /> + </update> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="IpBlockInstall failure and deletePool failed in EIPAM, need to manually delete" /> + </return> + </block> + </outcome> + </execute> + </outcome> + </configure> + </block> + </outcome> + <!--If no ptnii-name, check if VIPR or SRIOV--> + <outcome value=''> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' > + <parameter name="source" value="`toUpperCase($eipam-ip-block.plan-name)`" /> + <parameter name="target" value="AIC_" /> + <outcome value='false'> + <return status="failure"> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown Address Plan - not supported!" /> + </return> + </outcome> + <outcome value='true'> + <block atomic='true'> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $eipam-ip-block.plan-name and level = 2 and key_value = $tmp.level2-key-value ;" + pfx='tmp.eipam-pool-row'> + <outcome value='failure'> + <block atomic='true'> + <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="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="Failed to find this record in DB!"/> + </record> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" /> + </return> + </block> + </outcome> + <outcome value="not-found"> + <block atomic='true'> + <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="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="This record is not found in DB!"/> + </record> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" /> + </return> + </block> + </outcome> + </get-resource> + <!--initial subnet should exists--> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value and s.address_family = $tmp.version ; " + pfx='pfx.eipam-initial-subnet'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Initial subnet not found, cannot auto extend." /> + </return> + </outcome> + </get-resource> + <!--check if new subnet already exists, possibly from previous attempt.--> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * from EIPAM_IP_SUBNETS s WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = $eipam-ip-block.entity-id and s.ip_address = $eipam-ip-block.ip-address ; " + pfx='pfx.eipam-subnet-with-same-ip'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value="not-found"></outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id" + local-only="false" + pfx="aai.l3-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'Not found in AnAI'" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'from AnAI'" /> + </return> + </outcome> + </get-resource> + <set> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + </set> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNETS + SET + entity_id = $eipam-ip-block.entity-id , + service_type = $pfx.eipam-initial-subnet.service-type , + ip_address = $eipam-ip-block.ip-prefix , + prefix_length = $eipam-ip-block.mask , + plan_name = $eipam-ip-block.plan-name , + status = 'PENDING_ACTIVE' , + pool_id = $pfx.eipam-initial-subnet.pool-id , + address_family = $pfx.eipam-initial-subnet.address-family , + network_id = $pfx.eipam-initial-subnet.network-id ; " + force='true' + pfx='pfx.eipam-new-subnet'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNET_KEYS + SET + entity_id = $eipam-ip-block.entity-id , + key_name = $tmp.level1-key-name , + key_value = $tmp.level1-key-value , + level = 1 ; " + force='true' + pfx='pfx.eipam-subnet-level1'> + <outcome value='success'></outcome> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." /> + </return> + </outcome> + </save> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNET_KEYS + SET + entity_id = $eipam-ip-block.entity-id , + key_name = $tmp.level2-key-name , + key_value = $tmp.level2-key-value , + level = 2 ; " + force='true' + pfx='pfx.eipam-subnet-level2'> + <outcome value='success'></outcome> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." /> + </return> + </outcome> + </save> + <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="Added an entry for subnet-allocated-notification in EIPAM_IP_SUBNETS and EIPAM_IP_SUBNET_KEYS"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" + local-only="false" + pfx="tmp.aai-initial-subnet"> + <outcome value='not-found'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' is Not found in AnAI'" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' from AnAI'" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.l3-network.subnets.subnet_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'No subnets found in AAI for network-id=' + $pfx.eipam-initial-subnet.network-id" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='tmp.l3-network.subnet.subnet-name' value="`$aai.l3-network.network-name + '_S' + $aai.l3-network.subnets.subnet_length`" /> + </set> + </outcome> + </switch> + <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses"> + <parameter name="ipAddress" value="`$eipam-ip-block.ip-prefix`" /> + <parameter name="ipVersion" value="`tmp.version`" /> + <parameter name="subnet" value="`$eipam-ip-block.prefix-length`" /> + <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" /> + <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" /> + <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to generate gateway addresses using IpAddressTools" /> + </return> + </outcome> + </execute> + <switch test='`$tmp.aai-initial-subnet.dhcp-enabled`'> + <outcome value='Y'> + <block atomic="true"> + <set> + <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='true' /> + <parameter name='tmp.l3-network.subnet.dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' /> + <parameter name='tmp.l3-network.subnet.dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' /> + </set> + </block> + </outcome> + <outcome value='N'> + <block atomic="true"> + <set> + <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='false' /> + <parameter name='tmp.l3-network.subnet.dhcp-start' value='' /> + <parameter name='tmp.l3-network.subnet.dhcp-end' value='' /> + </set> + </block> + </outcome> + </switch> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <!-- Create l3-network object --> + <parameter name="network-id" value="`$pfx.eipam-initial-subnet.network-id`" /> + <parameter name="subnet-id" value="`$eipam-ip-block.entity-id`" /> + <parameter name="subnet-name" value="`$tmp.l3-network.subnet.subnet-name`" /> + <parameter name="gateway-address" value="`$tmp.return.generate.gateway-address`" /> + <parameter name="network-start-address" value="`$eipam-ip-block.ip-prefix`" /> + <parameter name="cidr-mask" value="`$eipam-ip-block.prefix-length`" /> + <parameter name="ip-version" value="`$tmp.version`" /> + <parameter name="dhcp-start" value="`$tmp.l3-network.subnet.dhcp-start`" /> + <parameter name="dhcp-end" value="`$tmp.l3-network.subnet.dhcp-end`" /> + <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet.dhcp-enabled`" /> + <parameter name="orchestration-status" value="PendingCreate" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Cannot save subnet with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /> + </return> + </outcome> + <outcome value='not-found'></outcome> + </save> + <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="Added a subnetin AAI"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='subnet' /> + <parameter name='api-action' value='add' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' /> + <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' /> + <parameter name='ip-prefix-len' value='`$eipam-ip-block.prefix-length`' /> + <parameter name='dns-server-address' value='0.0.0.0' /> + <parameter name='enable-dhcp' value='`$tmp.l3-network.subnet.dhcp-enabled`' /> + <parameter name='default-gateway' value='`$tmp.return.generate.gateway-address`' /> + <parameter name='subnet-name' value='`$tmp.l3-network.subnet.subnet-name`' /> + <parameter name='start' value='`$tmp.l3-network.subnet.dhcp-start`' /> + <parameter name='end' value='`$tmp.l3-network.subnet.dhcp-end`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + </save> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </save> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </block> + </outcome> + </execute> + <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="Added a subnet in Contrail"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <parameter name="orchestration-status" value="Created" /> + <outcome value='not-found'></outcome> + <outcome value='failure'> + <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="Update status to Created failed in AAI"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + </save> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='subnet' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' /> + <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to delete subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Cannot save subnet status to Created with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /> + </return> + </block> + </outcome> + </update> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'CREATED' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." /> + </return> + </outcome> + </save> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet"> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while activating subnet in EIPAM." /> + </return> + </outcome> + </execute> + <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'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to active in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to active in mysql." /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $aai.l3-network.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <parameter name="orchestration-status" value="Created" /> + <outcome value='failure'> + <return status="failure"> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." /> + </return> + </outcome> + </update> + <return status="success"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + </return> + </block> + </outcome> + </execute> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/graph.versions b/ms/generic-resource-api/src/test/resources/svclogic/graph.versions new file mode 100755 index 0000000..ba54f84 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/graph.versions @@ -0,0 +1,284 @@ +GENERIC-RESOURCE-API aai-get-aic-zone ${project.version} sync +GENERIC-RESOURCE-API aai-get-network-instance-group ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API assign-vlan-tags ${project.version} sync +GENERIC-RESOURCE-API auto-ip-assignment ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation ${project.version} sync +GENERIC-RESOURCE-API connection-attachment-topology-operation ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation ${project.version} sync +GENERIC-RESOURCE-API create-l3-subnet ${project.version} sync +GENERIC-RESOURCE-API create-route-target-and-vpn-binding ${project.version} sync +GENERIC-RESOURCE-API dci-connects-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API dci-connects-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API eipam-allocate-generic-subnet ${project.version} sync +GENERIC-RESOURCE-API eipam-allocate-network-role-subnet ${project.version} sync +GENERIC-RESOURCE-API eipam-create-generic-pool ${project.version} sync +GENERIC-RESOURCE-API eipam-create-network-role-pool ${project.version} sync +GENERIC-RESOURCE-API generate-allottedresource-id ${project.version} sync +GENERIC-RESOURCE-API generate-FQPN ${project.version} sync +GENERIC-RESOURCE-API generate-host-routes-host-route-id ${project.version} sync +GENERIC-RESOURCE-API generate-l3network-network-id ${project.version} sync +GENERIC-RESOURCE-API generate-panorama-name ${project.version} sync +GENERIC-RESOURCE-API generate-cp-instance-id ${project.version} sync +GENERIC-RESOURCE-API vf-module-generate-heat-parameters ${project.version} sync +GENERIC-RESOURCE-API generate-subnets-subnet-id ${project.version} sync +GENERIC-RESOURCE-API generate-unique-name ${project.version} sync +GENERIC-RESOURCE-API generate-vpn-binding-id ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-activate ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-assign ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-deactivate ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-unassign ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-topology-operation ${project.version} sync +GENERIC-RESOURCE-API get-complex-resource-service-model ${project.version} sync +GENERIC-RESOURCE-API get-data-from-policy ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-composite-match-pair ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-create-composite-path ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-create-simple-path ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-populate-from-grapi ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-populate-from-vnfapi ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-simple-match-pair ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-topology-operation ${project.version} sync +GENERIC-RESOURCE-API get-tunnelxconn-ar ${project.version} sync +GENERIC-RESOURCE-API get-vnf-api-parent-instance ${project.version} sync +GENERIC-RESOURCE-API gw-vfmodule-update ${project.version} sync +GENERIC-RESOURCE-API manage-ipaddr-assignment ${project.version} sync +GENERIC-RESOURCE-API manage-vni-assignment ${project.version} sync +GENERIC-RESOURCE-API naming-policy-generate-name ${project.version} sync +GENERIC-RESOURCE-API naming-policy-generate-unique-name ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-automated ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-from-preload ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-vlantagging-instancegroup ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation ${project.version} sync +GENERIC-RESOURCE-API policy-manager-create-policy ${project.version} sync +GENERIC-RESOURCE-API policy-manager-delete-policy ${project.version} sync +GENERIC-RESOURCE-API policy-update-notify-operation ${project.version} sync +GENERIC-RESOURCE-API port-mirror-get-policy ${project.version} sync +GENERIC-RESOURCE-API port-mirror-rollback-capacity-db ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-activate-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-activate-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-create-vnfcs ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-deactivate-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-deactivate-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-disable ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-enable ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-mapping-pprobe ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-mapping-vprobe ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-validation ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation ${project.version} sync +GENERIC-RESOURCE-API preload-network-topology-operation ${project.version} sync +GENERIC-RESOURCE-API preload-vf-module-topology-operation ${project.version} sync +GENERIC-RESOURCE-API process-eipam-pools ${project.version} sync +GENERIC-RESOURCE-API process-generic-eipam-pools ${project.version} sync +GENERIC-RESOURCE-API query-aai-l3-network-by-network-role ${project.version} sync +GENERIC-RESOURCE-API rollback-eipam-ip-assignment ${project.version} sync +GENERIC-RESOURCE-API rollback-generated-names ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-vf-module-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-vnf-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-pnf-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-capability-param-resolution ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-mS-mac-address-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-mS-vlan-tag-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-netbox-ip-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-unresolved-composite-data ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-unassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vfmodule-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vfmodule-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-forking-logic ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-mdsal-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vfmodule-mapping-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vfmodule-template-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-mdsal-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-unassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-forking-logic ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vnf-mapping-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vnf-template-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-unassign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-get-saved-ar-param ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation ${project.version} sync +GENERIC-RESOURCE-API validate-api-contrail-route-input ${project.version} sync +GENERIC-RESOURCE-API validate-brg-input ${project.version} sync +GENERIC-RESOURCE-API validate-connection-attachment-input ${project.version} sync +GENERIC-RESOURCE-API validate-contrail-route-input ${project.version} sync +GENERIC-RESOURCE-API validate-generic-configuration-input ${project.version} sync +GENERIC-RESOURCE-API validate-getpathsegment-input ${project.version} sync +GENERIC-RESOURCE-API validate-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-network-input ${project.version} sync +GENERIC-RESOURCE-API validate-overlay-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-security-zone-input ${project.version} sync +GENERIC-RESOURCE-API validate-service-input ${project.version} sync +GENERIC-RESOURCE-API validate-sotn-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-tunnelxconn-input ${project.version} sync +GENERIC-RESOURCE-API validate-vf-module-input ${project.version} sync +GENERIC-RESOURCE-API validate-vnf-input ${project.version} sync +GENERIC-RESOURCE-API validate-pnf-input ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-assign-rollback ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-no-preload ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-preload ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-activate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-assign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-deactivate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-ip-addresses ${project.version} sync +GENERIC-RESOURCE-API vnf-get-resource-request ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation ${project.version} sync +SUBNET-API managed-network-notification ${project.version} sync +SUBNET-API subnet-allocated-notification ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API validate-sdwan-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-tenant-auth ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-device-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-saved-ar-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-wan-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-wanport-vnf-topology-operation-underlay ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-device-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-site-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-wan-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-delete ${project.version} sync +GENERIC-RESOURCE-API validate-sdwan-vf-vpn-input-parameters ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-lanport-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-bandwidth-policy-change ${project.version} sync +GENERIC-RESOURCE-API send-so-response ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-get-vf-module-uni-param ${project.version} sync + diff --git a/ms/generic-resource-api/src/test/resources/testing.http b/ms/generic-resource-api/src/test/resources/testing.http new file mode 100644 index 0000000..ae17c53 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/testing.http @@ -0,0 +1,215 @@ +@baseUrl = http://localhost:8080 +@CONFIG_PRELOAD_URL = /config/GENERIC-RESOURCE-API:preload-information/ +@CONFIG_PRELOAD_LIST_URL = /config/GENERIC-RESOURCE-API:preload-information/GENERIC-RESOURCE-API:preload-list/ + +### GET top level no content-type : bad-media-type + +GET {{baseUrl}}/restconf{{CONFIG_PRELOAD_URL}} HTTP/1.1 +Accept: application/json +### GET top level json format + +GET {{baseUrl}}/restconf{{CONFIG_PRELOAD_URL}} HTTP/1.1 +Content-Type: application/json +Accept: application/json + +### GET top level xmlformat : 500 error + +GET {{baseUrl}}/restconf{{CONFIG_PRELOAD_URL}} HTTP/1.1 +Content-Type: application/xml +Accept: application/xml + +### just one entry + +GET {{baseUrl}}/restconf{{CONFIG_PRELOAD_LIST_URL}}/preload1/network/ HTTP/1.1 +content-type: application/json +Accept: application/json + +### request XML format : 500 error + +GET {{baseUrl}}/restconf{{CONFIG_PRELOAD_LIST_URL}}/preload1/network/ HTTP/1.1 +Content-Type: application/xml +Accept: application/xml + + +### delete all info + +DELETE {{baseUrl}}/restconf{{CONFIG_PRELOAD_URL}} HTTP/1.1 +content-type: application/json + +### delete specific entry : 500 error + +DELETE {{baseUrl}}/restconf{{CONFIG_PRELOAD_LIST_URL}}/preload1/network/ HTTP/1.1 +content-type: application/json + + +### add a new record preload1/network + +POST {{baseUrl}}/restconf{{CONFIG_PRELOAD_LIST_URL}}/preload1/network/ HTTP/1.1 +content-type: application/json + +{ + "preload-id": "preload1", + "preload-type": "network", + "preload-data": { + "preload-network-topology-information": { + "host-routes": [ + { + "next-hop": "10.1.12.1", + "route-prefix": "12" + } + ], + "is-external-network": false, + "is-provider-network": false, + "is-shared-network": false, + "network-policy": [ + { + "network-policy-fqdn": "policy-sdnc.onap.org", + "network-policy-id": "123" + } + ], + "network-topology-identifier-structure": { + "eipam-v4-address-plan": "plan9", + "eipam-v6-address-plan": "plan9v6", + "is-trunked": true, + "network-id": "preload1", + "network-instance-group-id": "abc123", + "network-name": "syfy", + "network-role": "secret", + "network-technology": "soupcan", + "network-type": "fake", + "related-networks": { + "related-network": [ + { + "network-id": "skynet", + "network-role": "master", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "le0" + } + } + ] + }, + "segmentation-id": "seg1" + }, + "physical-network-name": "skynet", + "route-table-reference": [ + { + "route-table-reference-fqdn": "sky.net", + "route-table-reference-id": "ref1" + } + ], + "subnets": [ + { + "addr-from-start": "Y", + "cidr-mask": "255.255.0.0", + "dhcp-enabled": "Y", + "dhcp-end-address": "10.1.2.254", + "dhcp-start-address": "10.1.2.1", + "gateway-address": "10.1.2.255", + "ip-version": "ipv4", + "start-address": "10.1.2.1", + "subnet-name": "subnet1", + "subnet-role": "puppies", + "subnet-sequence": 0 + } + ], + "vpn-bindings": [ + { + "aic-zone": "zone1", + "global-route-target": "string", + "route-target-role": "string", + "vpn-binding-id": "string", + "vpn-name": "string" + } + ] + } + } +} + +### +POST http://localhost:8080/restconf/config/GENERIC-RESOURCE-API:preload-information/GENERIC-RESOURCE-API:preload-list/preload1/network/ +content-type: application/xml + +<?xml version="1.0" encoding="UTF-8"?> +<preload-list> + <preload-data> + <preload-network-topology-information> + <host-routes> + <element> + <next-hop>10.1.12.1</next-hop> + <route-prefix>12</route-prefix> + </element> + </host-routes> + <is-external-network>false</is-external-network> + <is-provider-network>false</is-provider-network> + <is-shared-network>false</is-shared-network> + <network-policy> + <element> + <network-policy-fqdn>policy-sdnc.onap.org</network-policy-fqdn> + <network-policy-id>123</network-policy-id> + </element> + </network-policy> + <network-topology-identifier-structure> + <eipam-v4-address-plan>plan9</eipam-v4-address-plan> + <eipam-v6-address-plan>plan9v6</eipam-v6-address-plan> + <is-trunked>true</is-trunked> + <network-id>preload1</network-id> + <network-instance-group-id>abc123</network-instance-group-id> + <network-name>syfy</network-name> + <network-role>secret</network-role> + <network-technology>soupcan</network-technology> + <network-type>fake</network-type> + <related-networks> + <related-network> + <element> + <network-id>skynet</network-id> + <network-role>master</network-role> + <vlan-tags> + <is-private>true</is-private> + <lower-tag-id>0</lower-tag-id> + <upper-tag-id>0</upper-tag-id> + <vlan-interface>le0</vlan-interface> + </vlan-tags> + </element> + </related-network> + </related-networks> + <segmentation-id>seg1</segmentation-id> + </network-topology-identifier-structure> + <physical-network-name>skynet</physical-network-name> + <route-table-reference> + <element> + <route-table-reference-fqdn>sky.net</route-table-reference-fqdn> + <route-table-reference-id>ref1</route-table-reference-id> + </element> + </route-table-reference> + <subnets> + <element> + <addr-from-start>Y</addr-from-start> + <cidr-mask>255.255.0.0</cidr-mask> + <dhcp-enabled>Y</dhcp-enabled> + <dhcp-end-address>10.1.2.254</dhcp-end-address> + <dhcp-start-address>10.1.2.1</dhcp-start-address> + <gateway-address>10.1.2.255</gateway-address> + <ip-version>ipv4</ip-version> + <start-address>10.1.2.1</start-address> + <subnet-name>subnet1</subnet-name> + <subnet-role>puppies</subnet-role> + <subnet-sequence>0</subnet-sequence> + </element> + </subnets> + <vpn-bindings> + <element> + <aic-zone>zone1</aic-zone> + <global-route-target>string</global-route-target> + <route-target-role>string</route-target-role> + <vpn-binding-id>string</vpn-binding-id> + <vpn-name>string</vpn-name> + </element> + </vpn-bindings> + </preload-network-topology-information> + </preload-data> + <preload-id>preload1</preload-id> + <preload-type>network</preload-type> +</preload-list>
\ No newline at end of file |