2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.bpmn.buildingblock;
23 import org.apache.commons.lang.SerializationUtils;
24 import org.camunda.bpm.engine.delegate.BpmnError;
25 import java.util.ArrayList;
26 import org.json.JSONArray;
27 import org.json.JSONObject;
28 import org.onap.so.bpmn.common.BuildingBlockExecution;
29 import org.onap.so.bpmn.core.json.JsonUtils;
30 import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
31 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink;
38 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
39 import org.onap.so.bpmn.servicedecomposition.generalobjects.License;
40 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
41 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
42 import org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate;
43 import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
44 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
45 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionInfo;
46 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoMetadata;
47 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
48 import org.onap.so.client.exception.BadResponseException;
49 import org.onap.so.client.exception.ExceptionBuilder;
50 import org.onap.so.client.oof.OofClient;
51 import org.onap.so.client.oof.OofValidator;
52 import org.onap.so.client.oof.beans.ModelInfo;
53 import org.onap.so.client.oof.beans.OofRequest;
54 import org.onap.so.client.oof.beans.OofRequestParameters;
55 import org.onap.so.client.oof.beans.PlacementDemand;
56 import org.onap.so.client.oof.beans.PlacementInfo;
57 import org.onap.so.client.oof.beans.RequestInfo;
58 import org.onap.so.client.oof.beans.ResourceModelInfo;
59 import org.onap.so.client.oof.beans.ServiceInfo;
60 import org.onap.so.client.oof.beans.SubscriberInfo;
61 import org.onap.so.db.catalog.beans.OrchestrationStatus;
62 import org.slf4j.Logger;
63 import org.slf4j.LoggerFactory;
64 import org.springframework.beans.factory.annotation.Autowired;
65 import org.springframework.core.env.Environment;
66 import org.springframework.stereotype.Component;
67 import org.springframework.web.util.UriUtils;
69 import java.time.Duration;
70 import java.util.List;
72 import java.util.UUID;
74 import static org.apache.commons.lang3.StringUtils.isBlank;
75 import static org.apache.commons.lang3.StringUtils.isNotBlank;
79 * The oof homing building block obtains licensing and homing solutions for a given
80 * resource or set of resources.
83 @Component("OofHoming")
84 public class OofHomingV2 {
86 private static final Logger logger = LoggerFactory.getLogger(OofHomingV2.class);
87 private JsonUtils jsonUtils = new JsonUtils();
89 private Environment env;
91 private OofClient client;
93 private OofValidator oofValidator;
95 private ExceptionBuilder exceptionUtil;
96 private static final String MODEL_NAME = "modelName";
97 private static final String MODEL_INVARIANT_ID = "modelInvariantId";
98 private static final String MODEL_VERSION_ID = "modelVersionId";
99 private static final String MODEL_VERSION = "modelVersion";
100 private static final String SERVICE_RESOURCE_ID = "serviceResourceId";
101 private static final String RESOURCE_MODULE_NAME = "resourceModuleName";
102 private static final String RESOURCE_MODEL_INFO = "resourceModelInfo";
103 private static final String IDENTIFIER_TYPE = "identifierType";
104 private static final String INVENTORY_TYPE = "inventoryType";
105 private static final String SOLUTIONS = "solutions";
106 private static final String RESOURCE_MISSING_DATA = "Resource does not contain: ";
107 private static final String SERVICE_MISSING_DATA = "Service Instance does not contain: ";
108 private static final String UNPROCESSABLE = "422";
109 private static final int INTERNAL = 500;
112 * Generates the request payload then sends to Oof to perform homing and
113 * licensing for the provided demands
117 public void callOof(BuildingBlockExecution execution){
118 logger.trace("Started Sniro Homing Call Sniro");
120 GeneralBuildingBlock bb = execution.getGeneralBuildingBlock();
122 RequestContext requestContext = bb.getRequestContext();
123 RequestParameters requestParams = requestContext.getRequestParameters();
124 String requestId = requestContext.getMsoRequestId();
126 ServiceInstance serviceInstance = bb.getCustomer().getServiceSubscription().getServiceInstances().get(0);
127 Customer customer = bb.getCustomer();
129 String timeout = execution.getVariable("timeout");
130 if(isBlank(timeout)){
131 timeout = env.getProperty("oof.timeout", "PT30M");
134 OofRequest request = new OofRequest();
136 RequestInfo requestInfo = (RequestInfo)buildRequestInfo(requestId, timeout);
137 request.setRequestInformation(requestInfo);
139 ServiceInfo serviceInfo = buildServiceInfo(serviceInstance);
140 request.setServiceInformation(serviceInfo);
142 PlacementInfo placementInfo = buildPlacementInfo(customer, requestParams);
144 ArrayList<PlacementDemand> placementDemands = buildPlacementDemands(serviceInstance);
145 placementInfo.setPlacementDemands(placementDemands);
146 request.setPlacementInformation(placementInfo);
148 JSONObject licenseInfo = new JSONObject();
150 JSONArray licenseDemands = buildLicenseDemands(serviceInstance);
151 licenseInfo.put("licenseDemands", licenseDemands);
152 request.setLicenseInformation(licenseInfo.toString());
154 if(placementDemands.size() > 0 || licenseDemands.length() > 0){
155 client.postDemands(request);
157 logger.debug(SERVICE_MISSING_DATA + " resources eligible for homing or licensing");
158 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + " resources eligible for homing or licensing");
161 //Variables for ReceiveWorkflowMessage subflow
162 execution.setVariable("asyncCorrelator", requestId);
163 execution.setVariable("asyncMessageType", "OofResponse");
164 execution.setVariable("asyncTimeout", timeout);
166 logger.trace("Completed Oof Homing Call Oof");
168 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
169 }catch(BadResponseException e){
170 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
172 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while preparing oof request: " + e.getMessage());
177 * Validates, processes, and sets the homing and licensing solutions that are returned by
181 * @param asyncResponse
183 public void processSolution(BuildingBlockExecution execution, String asyncResponse){
184 logger.trace("Started Oof Homing Process Solution");
186 oofValidator.validateSolution(asyncResponse);
187 ServiceInstance serviceInstance = execution.getGeneralBuildingBlock().getCustomer().getServiceSubscription().getServiceInstances().get(0);
189 logger.debug("Processing Oof asyncronous response");
190 JSONObject response = new JSONObject(asyncResponse);
191 if(response.has(SOLUTIONS)){
192 JSONObject allSolutions = response.getJSONObject(SOLUTIONS);
193 if(allSolutions.has("placementSolutions")){
194 JSONArray placementSolutions = allSolutions.getJSONArray("placementSolutions");
195 for(int i = 0; i < placementSolutions.length(); i++){
196 JSONArray placements = placementSolutions.getJSONArray(i);
197 processPlacementSolution(serviceInstance, placements, i);
200 if(allSolutions.has("licenseSolutions")){
201 JSONArray licenseSolutions = allSolutions.getJSONArray("licenseSolutions");
202 if(licenseSolutions.length() > 0){
203 processLicenseSolution(serviceInstance, licenseSolutions);
207 throw new BpmnError(UNPROCESSABLE, "Oof response does not contain: " + SOLUTIONS);
210 execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
212 logger.trace("Completed Oof Homing Process Solution");
214 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
215 }catch(BadResponseException e){
216 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
218 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while processing Oof asynchronous response: " + e.getMessage());
223 * Builds the request information section for the homing/licensing request
227 private RequestInfo buildRequestInfo(String requestId, String timeout) throws Exception{
228 logger.trace("Building request information");
229 RequestInfo requestInfo = new RequestInfo();
230 if(requestId != null){
231 String host = env.getProperty("mso.workflow.message.endpoint");
232 String callbackUrl = host + "/" + UriUtils.encodePathSegment("OofResponse", "UTF-8") + "/" + UriUtils.encodePathSegment(requestId, "UTF-8");
234 Duration d = Duration.parse(timeout);
235 long timeoutSeconds = d.getSeconds();
237 requestInfo.setTransactionId(requestId);
238 requestInfo.setRequestId(requestId);
239 requestInfo.setCallbackUrl(callbackUrl);
240 requestInfo.setSourceId("mso");
241 requestInfo.setRequestType("create");
242 requestInfo.setTimeout(timeoutSeconds);
244 throw new BpmnError(UNPROCESSABLE, "Request Context does not contain: requestId");
250 * Builds the request information section for the homing/licensing request
253 private ServiceInfo buildServiceInfo(ServiceInstance serviceInstance){
254 logger.trace("Building service information");
255 ServiceInfo info = new ServiceInfo();
256 ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance();
257 if(isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())){
258 info.setServiceInstanceId(serviceInstance.getServiceInstanceId());
259 if(modelInfo.getServiceType() != null && modelInfo.getServiceType().length() > 0){ //temp solution
260 info.setServiceName(modelInfo.getServiceType());
262 info.setModelInfo(buildModelInfo(serviceInstance.getModelInfoServiceInstance()));
264 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + MODEL_VERSION_ID + ", " + MODEL_INVARIANT_ID);
270 * Builds initial section of placement info for the homing/licensing request
273 private PlacementInfo buildPlacementInfo(Customer customer, RequestParameters requestParams){
274 PlacementInfo placementInfo = new PlacementInfo();
275 if(customer != null){
276 logger.debug("Adding subscriber to placement information");
277 SubscriberInfo subscriberInfo = new SubscriberInfo();
278 subscriberInfo.setGlobalSubscriberId(customer.getGlobalCustomerId());
279 subscriberInfo.setSubscriberName(customer.getSubscriberName());
280 subscriberInfo.setSubscriberCommonSiteId(customer.getSubscriberCommonSiteId());
281 placementInfo.setSubscriberInfo(subscriberInfo);
282 if(requestParams != null){
283 logger.debug("Adding request parameters to placement information");
284 OofRequestParameters oofRequestParams = new OofRequestParameters();
285 for (Map requestParam : requestParams.getUserParams()){
286 if (requestParam.containsKey("customerLatitude")){
287 oofRequestParams.setCustomerLatitude(requestParam.get("customerLatitude").toString());
289 if (requestParam.containsKey("customerLongitude")){
290 oofRequestParams.setCustomerLongitude(requestParam.get("customerLongitude").toString());
292 if (requestParam.containsKey("customerName")){
293 oofRequestParams.setCustomerName(requestParam.get("customerName").toString());
296 placementInfo.setRequestParameters(oofRequestParams);
299 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "customer");
301 return placementInfo;
306 * Builds the placement demand list for the homing/licensing request
309 private ArrayList<PlacementDemand> buildPlacementDemands(ServiceInstance serviceInstance){
310 logger.trace("Building placement information demands");
311 ArrayList<PlacementDemand> placementDemands = new ArrayList();
313 List<AllottedResource> allottedResourceList = serviceInstance.getAllottedResources();
314 if(!allottedResourceList.isEmpty()){
315 logger.debug("Adding allotted resources to placement demands list");
316 for(AllottedResource ar : allottedResourceList){
317 if(isBlank(ar.getId())){
318 ar.setId(UUID.randomUUID().toString());
320 PlacementDemand demand = buildDemand(ar.getId(), ar.getModelInfoAllottedResource());
321 //addCandidates(ar, demand);
322 placementDemands.add(demand);
325 List<VpnBondingLink> vpnBondingLinkList = serviceInstance.getVpnBondingLinks();
326 if(!vpnBondingLinkList.isEmpty()){
327 logger.debug("Adding vpn bonding links to placement demands list");
328 for(VpnBondingLink vbl:vpnBondingLinkList){
329 List<ServiceProxy> serviceProxyList = vbl.getServiceProxies();
330 for(ServiceProxy sp : serviceProxyList){
331 if(isBlank(sp.getId())){
332 sp.setId(UUID.randomUUID().toString());
334 PlacementDemand demand = buildDemand(sp.getId(), sp.getModelInfoServiceProxy());
335 //addCandidates(sp, demand);
336 placementDemands.add(demand);
340 return placementDemands;
344 * Builds the license demand list for the homing/licensing request
347 private JSONArray buildLicenseDemands(ServiceInstance serviceInstance){
348 logger.trace("Building license information");
349 JSONArray licenseDemands = new JSONArray();
350 List<GenericVnf> vnfList = serviceInstance.getVnfs();
351 if(!vnfList.isEmpty()){
352 logger.debug("Adding vnfs to license demands list");
353 for(GenericVnf vnf : vnfList){
354 JSONObject demand = buildLicenseDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf());
355 licenseDemands.put(demand);
358 return licenseDemands;
362 * Builds a single license demand object
365 private JSONObject buildLicenseDemand(String id, ModelInfoMetadata metadata){
366 logger.debug("Building demand for service or resource: " + id);
367 JSONObject demand = new JSONObject();
368 if(isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())){
369 demand.put(SERVICE_RESOURCE_ID, id);
370 demand.put(RESOURCE_MODULE_NAME, metadata.getModelInstanceName());
371 demand.put(RESOURCE_MODEL_INFO, buildModelInfo(metadata));
373 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
379 * Builds a single demand object
382 private PlacementDemand buildDemand(String id, ModelInfoMetadata metadata){
383 logger.debug("Building demand for service or resource: " + id);
384 PlacementDemand placementDemand = new PlacementDemand();
385 if(isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())){
386 placementDemand.setServiceResourceId(id);
387 placementDemand.setResourceModuleName(metadata.getModelInstanceName());
388 placementDemand.setResourceModelInfo((ResourceModelInfo) buildModelInfo(metadata));
390 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
392 return placementDemand;
396 * Builds the resource model info section
399 private ModelInfo buildModelInfo(ModelInfoMetadata metadata){
400 ModelInfo modelInfo = new ModelInfo();
401 String invariantUuid = metadata.getModelInvariantUuid();
402 String modelUuid = metadata.getModelUuid();
403 if(isNotBlank(invariantUuid) && isNotBlank(modelUuid)){
404 modelInfo.setModelInvariantId(invariantUuid);
405 modelInfo.setModelVersionId(modelUuid);
406 modelInfo.setModelName(metadata.getModelName());
407 modelInfo.setModelVersion(metadata.getModelVersion());
408 }else if(isNotBlank(invariantUuid)){
409 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_VERSION_ID);
411 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_INVARIANT_ID);
417 * Adds required, excluded, and existing candidates to a demand
420 private void addCandidates(SolutionCandidates candidates, JSONObject demand){
421 List<Candidate> required = candidates.getRequiredCandidates();
422 List<Candidate> excluded = candidates.getExcludedCandidates();
423 if(!required.isEmpty()){
424 demand.put("requiredCandidates", required);
426 if(!excluded.isEmpty()){
427 demand.put("excludedCandidates", excluded);
429 //TODO support existing candidates
433 * Processes the license solutions and sets to the corresponding generic vnf
436 private void processLicenseSolution(ServiceInstance serviceInstance, JSONArray licenseSolutions){
437 List<GenericVnf> vnfs = serviceInstance.getVnfs();
439 logger.debug("Processing the license solution");
440 for(int i = 0; i < licenseSolutions.length(); i++){
441 JSONObject licenseSolution = licenseSolutions.getJSONObject(i);
442 for(GenericVnf vnf:vnfs){
443 if(licenseSolution.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())){
444 License license = new License();
445 JSONArray entitlementPools = licenseSolution.getJSONArray("entitlementPoolUUID");
446 List<String> entitlementPoolsList = jsonUtils.StringArrayToList(entitlementPools);
447 license.setEntitlementPoolUuids(entitlementPoolsList);
448 JSONArray licenseKeys = licenseSolution.getJSONArray("licenseKeyGroupUUID");
449 List<String> licenseKeysList = jsonUtils.StringArrayToList(licenseKeys);
450 license.setLicenseKeyGroupUuids(licenseKeysList);
452 vnf.setLicense(license);
459 * Processes a placement solution list then correlates and sets each placement solution
460 * to its corresponding resource
463 private void processPlacementSolution(ServiceInstance serviceInstance, JSONArray placements, int i){
464 List<VpnBondingLink> links = serviceInstance.getVpnBondingLinks();
465 List<AllottedResource> allottes = serviceInstance.getAllottedResources();
466 List<GenericVnf> vnfs = serviceInstance.getVnfs();
468 logger.debug("Processing placement solution " + i+1);
469 for(int p = 0; p < placements.length(); p++){
470 JSONObject placement = placements.getJSONObject(p);
471 SolutionInfo solutionInfo = new SolutionInfo();
472 solutionInfo.setSolutionId(i + 1);
474 for(VpnBondingLink vbl:links){
475 List<ServiceProxy> proxies = vbl.getServiceProxies();
476 for(ServiceProxy sp:proxies){
477 if(placement.getString(SERVICE_RESOURCE_ID).equals(sp.getId())){
480 VpnBondingLink vblNew = (VpnBondingLink) SerializationUtils.clone(vbl);
481 vblNew.setVpnBondingLinkId(UUID.randomUUID().toString());
484 links.get(links.size() - 1).getServiceProxy(sp.getId()).setServiceInstance(setSolution(solutionInfo, placement));
486 sp.setServiceInstance(setSolution(solutionInfo, placement));
492 for(AllottedResource ar:allottes){
493 if(placement.getString(SERVICE_RESOURCE_ID).equals(ar.getId())){
494 ar.setParentServiceInstance(setSolution(solutionInfo, placement));
498 for(GenericVnf vnf:vnfs){
499 if(placement.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())){
500 ServiceInstance si = setSolution(solutionInfo, placement);
501 serviceInstance.setSolutionInfo(si.getSolutionInfo());
502 serviceInstance.getVnfs().add(si.getVnfs().get(0));
512 * Creates and sets necessary pojos with placement solution data for a given demand
515 private ServiceInstance setSolution(SolutionInfo solutionInfo, JSONObject placement){
516 logger.debug("Mapping placement solution");
517 String invalidMessage = "Oof Response contains invalid: ";
519 JSONObject solution = placement.getJSONObject("solution");
520 String identifierType = solution.getString(IDENTIFIER_TYPE);
521 List<String> identifiersList = jsonUtils.StringArrayToList(solution.getJSONArray("identifiers").toString());
522 String identifierValue = identifiersList.get(0);
524 JSONArray assignments = placement.getJSONArray("assignmentInfo");
525 Map<String, String> assignmentsMap = jsonUtils.entryArrayToMap(assignments.toString(), "key", "value");
526 solutionInfo.setRehome(Boolean.parseBoolean(assignmentsMap.get("isRehome")));
527 String type = placement.getString(INVENTORY_TYPE);
529 ServiceInstance si = new ServiceInstance();
530 CloudRegion cloud = setCloud(assignmentsMap);
531 if(type.equals("service")){
532 if(identifierType.equals(CandidateType.SERVICE_INSTANCE_ID.toString())){
533 solutionInfo.setHomed(true);
534 si.setServiceInstanceId(identifierValue);
535 si.setOrchestrationStatus(OrchestrationStatus.CREATED);
536 cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId"));
537 if(assignmentsMap.containsKey("vnfHostName")){
538 logger.debug("Resources has been homed to a vnf");
539 GenericVnf vnf = setVnf(assignmentsMap);
540 vnf.setCloudRegion(cloud);
541 si.getVnfs().add(vnf);
543 }else if(assignmentsMap.containsKey("primaryPnfName")){
544 logger.debug("Resources has been homed to a pnf");
545 Pnf priPnf = setPnf(assignmentsMap, "primary");
546 priPnf.setCloudRegion(cloud);
547 si.getPnfs().add(priPnf);
548 if(assignmentsMap.containsKey("secondaryPnfName")){
549 Pnf secPnf = setPnf(assignmentsMap, "secondary");
550 secPnf.setCloudRegion(cloud);
551 si.getPnfs().add(secPnf);
555 logger.debug(invalidMessage + IDENTIFIER_TYPE);
556 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
558 }else if(type.equals("cloud")){
559 if(identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())){
560 logger.debug("Resources has been homed to a cloud region");
561 cloud.setLcpCloudRegionId(identifierValue);
562 solutionInfo.setHomed(false);
563 solutionInfo.setTargetedCloudRegion(cloud);
564 si.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
566 logger.debug(invalidMessage + IDENTIFIER_TYPE);
567 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
570 logger.debug(invalidMessage + INVENTORY_TYPE);
571 throw new BpmnError(UNPROCESSABLE, invalidMessage + INVENTORY_TYPE);
573 si.setSolutionInfo(solutionInfo);
578 * Sets the cloud data to a cloud region object
581 private CloudRegion setCloud(Map<String, String> assignmentsMap){
582 CloudRegion cloud = new CloudRegion();
583 cloud.setCloudOwner(assignmentsMap.get("cloudOwner"));
584 cloud.setCloudRegionVersion(assignmentsMap.get("aicVersion"));
585 cloud.setComplex(assignmentsMap.get("aicClli"));
590 * Sets the vnf data to a generic vnf object
593 private GenericVnf setVnf(Map<String, String> assignmentsMap){
594 GenericVnf vnf = new GenericVnf();
595 vnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
596 vnf.setVnfName(assignmentsMap.get("vnfHostName"));
597 vnf.setVnfId(assignmentsMap.get("vnfId"));
602 * Sets the pnf data to a pnf object
605 private Pnf setPnf(Map<String, String> assignmentsMap, String role){
608 pnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
609 pnf.setPnfName(assignmentsMap.get(role + "PnfName"));