Added CSIT for Macroflow with HEAT
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / sdnc-simulator / src / main / java / org / onap / so / sdncsimulator / providers / ServiceOperationsCacheServiceProviderimpl.java
index d5e991a..90255de 100644 (file)
@@ -36,6 +36,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import javax.validation.Valid;
+
 import org.onap.sdnc.northbound.client.model.GenericResourceApiInstanceReference;
 import org.onap.sdnc.northbound.client.model.GenericResourceApiLastActionEnumeration;
 import org.onap.sdnc.northbound.client.model.GenericResourceApiLastRpcActionEnumeration;
@@ -60,6 +61,17 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnf
 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfRequestInput;
 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology;
 import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyidentifierstructureVnfTopologyIdentifierStructure;
+
+import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfTopology;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyVfModuleTopology;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
+
 import org.onap.so.sdncsimulator.models.Output;
 import org.onap.so.simulator.cache.provider.AbstractCacheServiceProvider;
 import org.slf4j.Logger;
@@ -78,7 +90,13 @@ import org.springframework.stereotype.Service;
 public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServiceProvider
         implements ServiceOperationsCacheServiceProvider {
 
+    private static final String HTTP_STATUS_BAD_REQUEST = Integer.toString(HttpStatus.BAD_REQUEST.value());
+    private static final String HTTP_STATUS_OK = Integer.toString(HttpStatus.OK.value());
+    private static final String EMPTY_STRING = "";
     private static final Logger LOGGER = LoggerFactory.getLogger(ServiceOperationsCacheServiceProviderimpl.class);
+    private static List<GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData> vfModuleList;
+    GenericResourceApiVfModuleTopology genericResourceApiVfModuleTopology = new GenericResourceApiVfModuleTopology();
+    GenericResourceApiVnfTopology genericResourceApiVnfTopology = new GenericResourceApiVnfTopology();
 
     @Autowired
     public ServiceOperationsCacheServiceProviderimpl(final CacheManager cacheManager) {
@@ -89,32 +107,69 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
     public Output putServiceOperationInformation(final GenericResourceApiServiceOperationInformation input) {
 
         final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
-        final String svcRequestId = requestHeader != null ? requestHeader.getSvcRequestId() : null;
+        final String svcRequestId = getSvcRequestId(requestHeader);
 
         final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
         if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId())) {
-            final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
             final String serviceInstanceId = serviceInformation.getServiceInstanceId();
-            LOGGER.info("Adding GenericResourceApiServiceOperationInformation to cache with key: {}",
-                    serviceInstanceId);
 
-            final GenericResourceApiServicemodelinfrastructureService service =
-                    getServiceItem(input, serviceInstanceId);
-            cache.put(serviceInstanceId, service);
+            if (isServiceOperationInformationNotExists(serviceInstanceId, input)) {
+                final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
+                LOGGER.info("Adding GenericResourceApiServiceOperationInformation to cache with key: {}",
+                        serviceInstanceId);
 
-            final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
+                final GenericResourceApiServicemodelinfrastructureService service =
+                        getServiceItem(input, serviceInstanceId);
+                cache.put(serviceInstanceId, service);
 
-            return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
-                    .responseCode(serviceStatus.getResponseCode()).responseMessage(serviceStatus.getResponseMessage())
-                    .svcRequestId(svcRequestId).serviceResponseInformation(new GenericResourceApiInstanceReference()
-                            .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId)));
+                final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
 
+                return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
+                        .responseCode(serviceStatus.getResponseCode())
+                        .responseMessage(serviceStatus.getResponseMessage()).svcRequestId(svcRequestId)
+                        .serviceResponseInformation(new GenericResourceApiInstanceReference()
+                                .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId)));
+            }
+            LOGGER.error("serviceInstanceId: {} already exists", serviceInstanceId);
+            return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
+                    .responseMessage("serviceInstanceId: " + serviceInstanceId + " already exists")
+                    .svcRequestId(svcRequestId);
         }
+
         LOGGER.error(
                 "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ",
                 input);
-        return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
+        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
                 .responseMessage("Service instance not found").svcRequestId(svcRequestId);
+
+    }
+
+    @Override
+    public Output deleteServiceOperationInformation(final GenericResourceApiServiceOperationInformation input) {
+        final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
+        final String svcRequestId = getSvcRequestId(input.getSdncRequestHeader());
+
+        if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId())) {
+            final String serviceInstanceId = serviceInformation.getServiceInstanceId();
+            final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
+                    getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
+            if (optional.isPresent()) {
+                final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
+                LOGGER.info("Deleting GenericResourceApiServiceOperationInformation from cache using key: {}",
+                        serviceInstanceId);
+                cache.evict(serviceInstanceId);
+                return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_OK)
+                        .responseMessage(EMPTY_STRING).svcRequestId(svcRequestId).serviceResponseInformation(
+                                new GenericResourceApiInstanceReference().instanceId(serviceInstanceId));
+            }
+            LOGGER.error(
+                    "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
+                    serviceInstanceId);
+
+        }
+        LOGGER.error("Unable to remove service instance from cache due to invalid input: {}... ", input);
+        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
+                .responseMessage("Unable to remove service").svcRequestId(svcRequestId);
     }
 
     @Override
@@ -140,7 +195,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
         final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation();
 
         final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
-        final String svcRequestId = requestHeader != null ? requestHeader.getSvcRequestId() : null;
+        final String svcRequestId = getSvcRequestId(requestHeader);
 
         if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null
                 && isValid(vnfInformation.getVnfId())) {
@@ -158,7 +213,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
 
                     if (ifVnfNotExists(vnfId, svcAction, vnfsList)) {
                         vnfsList.add(getGenericResourceApiServicedataVnf(serviceInstanceId, vnfId, input));
-
+                        getVnfsList(vnfsList);
                         final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
 
                         return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
@@ -170,7 +225,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
                                         .objectPath(getObjectPath(serviceInstanceId, vnfId)));
                     }
                     LOGGER.error("vnfId: {} already exists with SVC Action: {}", vnfId, svcAction);
-                    return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
+                    return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
                             .responseMessage("vnfId: " + vnfId + " already exists").svcRequestId(svcRequestId);
                 }
             }
@@ -182,10 +237,66 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
         LOGGER.error(
                 "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ",
                 input);
-        return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString())
+        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
                 .responseMessage("Unable to add vnf").svcRequestId(svcRequestId);
     }
 
+    @Override
+    public Output deleteVnfOperationInformation(final GenericResourceApiVnfOperationInformation input) {
+        final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
+        final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation();
+
+        final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
+        final String svcRequestId = getSvcRequestId(requestHeader);
+
+        if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null
+                && isValid(vnfInformation.getVnfId())) {
+            final String serviceInstanceId = serviceInformation.getServiceInstanceId();
+            final String vnfId = vnfInformation.getVnfId();
+            final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
+                    getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
+            if (optional.isPresent()) {
+                final GenericResourceApiServicemodelinfrastructureService service = optional.get();
+                final GenericResourceApiServicedataServiceData serviceData = service.getServiceData();
+                if (serviceData != null) {
+                    final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList = getVnfs(serviceData);
+                    final Optional<GenericResourceApiServicedataServicedataVnfsVnf> vnfInstanceOptional =
+                            getExistingVnf(vnfId, vnfsList);
+
+                    if (vnfInstanceOptional.isPresent()) {
+                        vnfsList.removeIf(vnf -> {
+                            final String existingVnfId = vnf.getVnfId();
+                            if (existingVnfId != null && existingVnfId.equals(vnfId)) {
+                                LOGGER.info("Remove vnf with id: {} ... ", existingVnfId);
+                                return true;
+                            }
+                            return false;
+                        });
+
+                        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_OK)
+                                .responseMessage(EMPTY_STRING).svcRequestId(svcRequestId)
+                                .serviceResponseInformation(
+                                        new GenericResourceApiInstanceReference().instanceId(serviceInstanceId))
+                                .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId));
+                    }
+
+                }
+            }
+            LOGGER.error(
+                    "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
+                    serviceInstanceId);
+
+        }
+        LOGGER.error("Unable to remove vnf instance from cache due to invalid input: {}... ", input);
+        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
+                .responseMessage("Unable to remove vnf").svcRequestId(svcRequestId);
+
+    }
+
+    private String getSvcRequestId(final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader) {
+        return requestHeader != null ? requestHeader.getSvcRequestId() : null;
+    }
+
     @Override
     public void clearAll() {
         clearCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
@@ -228,9 +339,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
 
     private Optional<GenericResourceApiServicedataServicedataVnfsVnf> getExistingVnf(final String vnfId,
             final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList) {
-        final Optional<GenericResourceApiServicedataServicedataVnfsVnf> optional =
-                vnfsList.stream().filter(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)).findFirst();
-        return optional;
+        return vnfsList.stream().filter(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)).findFirst();
     }
 
     private List<GenericResourceApiServicedataServicedataVnfsVnf> getVnfs(
@@ -313,17 +422,13 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
         apiServicedataServiceData.serviceLevelOperStatus(getServiceLevelOperStatus(input));
 
         final GenericResourceApiServicestatusServiceStatus serviceStatus =
-                getServiceStatus(getSvcAction(input.getSdncRequestHeader()), getAction(input.getRequestInformation()),
-                        HttpStatus.OK.toString());
+                getServiceStatus(getSvcAction(input.getSdncRequestHeader()),
+                        getRequestAction(input.getRequestInformation()), HTTP_STATUS_OK);
 
         return new GenericResourceApiServicemodelinfrastructureService().serviceData(apiServicedataServiceData)
                 .serviceStatus(serviceStatus).serviceInstanceId(serviceInstanceId);
     }
 
-    private String getAction(final GenericResourceApiRequestinformationRequestInformation input) {
-        return getString(input.getRequestAction(), "");
-    }
-
     private String getSvcAction(final GenericResourceApiSdncrequestheaderSdncRequestHeader input) {
         return input != null ? getStringOrNull(input.getSvcAction()) : null;
     }
@@ -333,7 +438,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
         return new GenericResourceApiServicestatusServiceStatus().finalIndicator(YES)
                 .rpcAction(GenericResourceApiRpcActionEnumeration.fromValue(rpcAction))
                 .rpcName(SERVICE_TOPOLOGY_OPERATION).responseTimestamp(LocalDateTime.now().toString())
-                .responseCode(responseCode).requestStatus(SYNCCOMPLETE).responseMessage("").action(action);
+                .responseCode(responseCode).requestStatus(SYNCCOMPLETE).responseMessage(EMPTY_STRING).action(action);
     }
 
     private GenericResourceApiOperStatusData getServiceLevelOperStatus(
@@ -351,7 +456,12 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
     }
 
     private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input) {
-        return input != null ? getStringOrNull(input.getRequestAction()) : null;
+        return getRequestAction(input, EMPTY_STRING);
+    }
+
+    private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input,
+            final String defaultValue) {
+        return input != null ? getString(input.getRequestAction(), defaultValue) : defaultValue;
     }
 
     private GenericResourceApiServicetopologyServiceTopology getServiceTopology(
@@ -383,4 +493,157 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ
 
     }
 
-}
+    private boolean isServiceOperationInformationNotExists(final String serviceInstanceId,
+            final GenericResourceApiServiceOperationInformation input) {
+        final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
+        final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
+                getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
+
+        if (optional.isPresent()) {
+            final GenericResourceApiServicemodelinfrastructureService existingService = optional.get();
+            final GenericResourceApiServicestatusServiceStatus serviceStatus = existingService.getServiceStatus();
+            if (serviceStatus != null) {
+                final GenericResourceApiRpcActionEnumeration rpcAction = serviceStatus.getRpcAction();
+                final String svcAction = getSvcAction(requestHeader);
+                if (rpcAction != null && rpcAction.toString().equals(svcAction)) {
+                    LOGGER.error("Found Service with id: {} and RpcAction: {} same as SvcAction:  {}",
+                            serviceInstanceId, rpcAction, svcAction);
+                    return false;
+                }
+
+                final Cache cache = getCache(SERVICE_TOPOLOGY_OPERATION_CACHE);
+                LOGGER.info(
+                        "Deleting existing GenericResourceApiServiceOperationInformation from cache using key: {} as SvcAction is changed from {} to {}",
+                        serviceInstanceId, rpcAction, svcAction);
+                cache.evict(serviceInstanceId);
+            }
+        }
+        return true;
+
+    }
+
+       @Override
+       public Output putVfModuleOperationInformation(
+                       GenericResourceApiVfModuleOperationInformation input) {
+
+               final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation();
+        final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation();
+        final GenericResourceApiVfmoduleinformationVfModuleInformation vfModuleInformation = input.getVfModuleInformation();
+        // Call getVfModule to make a vfList for get the vf-module-information while GET reqest
+        vfModuleList = getVfModule(input);
+
+        final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader();
+        final String svcRequestId = getSvcRequestId(requestHeader);
+
+        if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null
+                && isValid(vnfInformation.getVnfId()) && vfModuleInformation !=null && isValid(vfModuleInformation.getVfModuleId())) {
+
+
+            final String serviceInstanceId = serviceInformation.getServiceInstanceId();
+            final String vnfId = vnfInformation.getVnfId();
+            final String vfModuleId =  vfModuleInformation.getVfModuleId();
+
+            final Optional<GenericResourceApiServicemodelinfrastructureService> optional =
+                    getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId);
+            if (optional.isPresent()) {
+                final GenericResourceApiServicemodelinfrastructureService service = optional.get();
+                final GenericResourceApiServicedataServiceData serviceData = service.getServiceData();
+                if (serviceData != null) {
+                  
+                        final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus();
+
+                        return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator())
+                                .responseCode(serviceStatus.getResponseCode())
+                                .responseMessage(serviceStatus.getResponseMessage()).svcRequestId(svcRequestId)
+                                .serviceResponseInformation(new GenericResourceApiInstanceReference()
+                                        .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId)))
+                                .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId)
+                                        .objectPath(getObjectPath(serviceInstanceId, vnfId)))
+                                .vfModuleResponseInformation(new GenericResourceApiInstanceReference().instanceId(vfModuleId)
+                                               .objectPath(getObjectPath(vnfId, vfModuleId)));
+                }
+            }
+            LOGGER.error(
+                    "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}",
+                    serviceInstanceId);
+        }
+        LOGGER.error(
+                "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ",
+                input);
+        return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST)
+                .responseMessage("Unable to add vfModule").svcRequestId(svcRequestId);
+       }
+
+    private List<GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData> getVfModule(GenericResourceApiVfModuleOperationInformation input) {
+        
+       final GenericResourceApiVfmoduletopologyVfModuleTopology apiVfModuletopologyVfModuleTopology =
+                new GenericResourceApiVfmoduletopologyVfModuleTopology();
+       
+       GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData vfModuleData =
+                new GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData();
+        vfModuleData.setVfModuleInformation(input.getVfModuleInformation());
+        vfModuleData.setVfModuleRequestInput(input.getVfModuleRequestInput());
+               GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = new GenericResourceApiVfmoduletopologyVfModuleTopology();
+               
+               vfModuleTopology.setSdncGeneratedCloudResources(true);
+               GenericResourceApiParam vfModuleParametersData = new GenericResourceApiParam();
+               List<GenericResourceApiParamParam> params = new ArrayList<GenericResourceApiParamParam>();
+               GenericResourceApiParamParam param = new GenericResourceApiParamParam();
+               param.setName("k8s-rb-profile-name");
+               param.setValue("k8s-rb-profile-value");
+       
+               params.add(param);
+               vfModuleParametersData.setParam(params);
+               vfModuleTopology.setVfModuleParameters(vfModuleParametersData);
+        
+        vfModuleTopology.setOnapModelInformation(vfModuleData.getVfModuleInformation().getOnapModelInformation());
+        vfModuleTopology.setVfModuleParameters(vfModuleData.getVfModuleRequestInput().getVfModuleInputParameters());
+        vfModuleTopology.setAicClli(vfModuleData.getVfModuleRequestInput().getAicClli());
+        vfModuleTopology.setAicCloudRegion(vfModuleData.getVfModuleRequestInput().getAicCloudRegion());
+        vfModuleTopology.setCloudOwner(vfModuleData.getVfModuleRequestInput().getCloudOwner());
+        
+        apiVfModuletopologyVfModuleTopology.vfModuleTopologyIdentifier(getVfModuleTopologyIdentifierStructure(input));
+        
+        vfModuleTopology.setVfModuleTopologyIdentifier(apiVfModuletopologyVfModuleTopology.getVfModuleTopologyIdentifier());
+        vfModuleTopology.setTenant(vfModuleData.getVfModuleRequestInput().getTenant());
+
+        genericResourceApiVfModuleTopology.setVfModuleTopology(vfModuleTopology);
+   
+       return null;
+
+    }
+
+       public GenericResourceApiVfModuleTopology getGenericResourceApiVfModuleTopology() {
+               return genericResourceApiVfModuleTopology;
+       }
+       
+       private GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier getVfModuleTopologyIdentifierStructure(
+            @Valid final GenericResourceApiVfModuleOperationInformation input) {
+               
+               final GenericResourceApiVfmoduleinformationVfModuleInformation vfModuleInformation = input.getVfModuleInformation();
+        return new GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier()
+                .vfModuleId(vfModuleInformation.getVfModuleId()).vfModuleType(vfModuleInformation.getVfModuleType()).vfModuleName(input.getVfModuleRequestInput().getVfModuleName());
+    }
+       
+       public GenericResourceApiVnfTopology getGenericResourceApiVnfTopology() {
+               return genericResourceApiVnfTopology;
+       }
+
+       public void getVnfsList(List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList) {
+               
+               GenericResourceApiVnftopologyVnfTopology vnfTopology = new GenericResourceApiVnftopologyVnfTopology();
+               LOGGER.info(String.valueOf(vnfsList));
+               vnfTopology.setOnapModelInformation(vnfsList.get(0).getVnfData().getVnfInformation().getOnapModelInformation());
+        vnfTopology.setAicClli(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getAicClli()));
+        vnfTopology.setAicCloudRegion(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getAicCloudRegion()));
+        vnfTopology.setCloudOwner(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getCloudOwner()));
+        vnfTopology.setTenant(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getTenant()));
+        vnfTopology.setVnfResourceAssignments(vnfsList.get(0).getVnfData().getVnfTopology().getVnfResourceAssignments());
+        vnfTopology.setVnfTopologyIdentifierStructure(vnfsList.get(0).getVnfData().getVnfTopology().getVnfTopologyIdentifierStructure());
+        vnfTopology.setVnfParametersData(vnfsList.get(0).getVnfData().getVnfTopology().getVnfParametersData());
+        vnfTopology.setSdncGeneratedCloudResources(vnfsList.get(0).getVnfData().getVnfTopology().getSdncGeneratedCloudResources());
+               
+        genericResourceApiVnfTopology.setVnfTopology(vnfTopology);
+       }
+}
\ No newline at end of file