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 static org.apache.commons.lang3.StringUtils.*;
25 import java.time.Duration;
26 import java.util.ArrayList;
27 import java.util.List;
29 import java.util.UUID;
31 import org.apache.commons.lang.SerializationUtils;
32 import org.camunda.bpm.engine.delegate.BpmnError;
33 import org.json.JSONArray;
34 import org.json.JSONObject;
35 import org.onap.so.bpmn.common.BuildingBlockExecution;
36 import org.onap.so.bpmn.core.json.JsonUtils;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
39 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
40 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
41 import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
42 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
43 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy;
44 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink;
45 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
46 import org.onap.so.bpmn.servicedecomposition.generalobjects.License;
47 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
48 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
49 import org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate;
50 import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
51 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
52 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionInfo;
53 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoMetadata;
54 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
55 import org.onap.so.client.exception.BadResponseException;
56 import org.onap.so.client.exception.ExceptionBuilder;
58 import org.onap.so.client.sniro.SniroClient;
59 import static org.onap.so.client.sniro.SniroValidator.*;
61 import org.onap.so.client.sniro.beans.Demand;
62 import org.onap.so.client.sniro.beans.LicenseInfo;
63 import org.onap.so.client.sniro.beans.ModelInfo;
64 import org.onap.so.client.sniro.beans.PlacementInfo;
65 import org.onap.so.client.sniro.beans.RequestInfo;
66 import org.onap.so.client.sniro.beans.ServiceInfo;
67 import org.onap.so.client.sniro.beans.SniroManagerRequest;
68 import org.onap.so.client.sniro.beans.SubscriberInfo;
69 import org.onap.so.db.catalog.beans.OrchestrationStatus;
70 import org.onap.so.logger.MsoLogger;
71 import org.springframework.beans.factory.annotation.Autowired;
72 import org.springframework.core.env.Environment;
73 import org.springframework.stereotype.Component;
74 import org.springframework.web.util.UriUtils;
78 * The sniro homing building block obtains licensing and homing solutions for a given
79 * resource or set of resources.
84 @Component("SniroHoming")
85 public class SniroHomingV2 {
87 private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroHomingV2.class);
88 private JsonUtils jsonUtils = new JsonUtils();
90 private Environment env;
92 private SniroClient client;
94 private ExceptionBuilder exceptionUtil;
95 private static final String MODEL_NAME = "modelName";
96 private static final String MODEL_INVARIANT_ID = "modelInvariantId";
97 private static final String MODEL_VERSION_ID = "modelVersionId";
98 private static final String MODEL_VERSION = "modelVersion";
99 private static final String SERVICE_RESOURCE_ID = "serviceResourceId";
100 private static final String RESOURCE_MODULE_NAME = "resourceModuleName";
101 private static final String RESOURCE_MODEL_INFO = "resourceModelInfo";
102 private static final String IDENTIFIER_TYPE = "identifierType";
103 private static final String INVENTORY_TYPE = "inventoryType";
104 private static final String SOLUTIONS = "solutions";
105 private static final String RESOURCE_MISSING_DATA = "Resource does not contain: ";
106 private static final String SERVICE_MISSING_DATA = "Service Instance does not contain: ";
107 private static final String UNPROCESSABLE = "422";
108 private static final int INTERNAL = 500;
111 * Generates the request payload then sends to sniro manager to perform homing and
112 * licensing for the provided demands
116 public void callSniro(BuildingBlockExecution execution){
117 log.debug("Started Sniro Homing Call Sniro");
119 GeneralBuildingBlock bb = execution.getGeneralBuildingBlock();
121 RequestContext requestContext = bb.getRequestContext();
122 RequestParameters requestParams = requestContext.getRequestParameters();
123 String requestId = requestContext.getMsoRequestId();
125 ServiceInstance serviceInstance = bb.getCustomer().getServiceSubscription().getServiceInstances().get(0);
126 Customer customer = bb.getCustomer();
128 String timeout = execution.getVariable("timeout");
129 if(isBlank(timeout)){
130 timeout = env.getProperty("sniro.manager.timeout", "PT30M");
133 SniroManagerRequest request = new SniroManagerRequest();
135 RequestInfo requestInfo = buildRequestInfo(requestId, timeout);
136 request.setRequestInformation(requestInfo);
138 ServiceInfo serviceInfo = buildServiceInfo(serviceInstance);
139 request.setServiceInformation(serviceInfo);
141 PlacementInfo placementInfo = buildPlacementInfo(customer, requestParams);
143 List<Demand> placementDemands = buildPlacementDemands(serviceInstance);
144 placementInfo.setDemands(placementDemands);
145 request.setPlacementInformation(placementInfo);
147 LicenseInfo licenseInfo = new LicenseInfo();
149 List<Demand> licenseDemands = buildLicenseDemands(serviceInstance);
150 licenseInfo.setDemands(licenseDemands);
151 request.setLicenseInformation(licenseInfo);
153 if(placementDemands.size() > 0 || licenseDemands.size() > 0){
154 client.postDemands(request);
156 log.debug(SERVICE_MISSING_DATA + "resources eligible for homing or licensing");
157 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "resources eligible for homing or licensing");
160 //Variables for ReceiveWorkflowMessage subflow
161 execution.setVariable("asyncCorrelator", requestId);
162 execution.setVariable("asyncMessageType", "SNIROResponse");
163 execution.setVariable("asyncTimeout", timeout);
165 log.trace("Completed Sniro Homing Call Sniro");
168 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
169 }catch(BadResponseException e){
171 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
174 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while preparing sniro request: " + e.getMessage());
179 * Validates, processes, and sets the homing and licensing solutions that are returned by
183 * @param asyncResponse
185 public void processSolution(BuildingBlockExecution execution, String asyncResponse){
186 log.trace("Started Sniro Homing Process Solution");
188 //TODO improve handling multiple solutions but is dependent on sniro enhancing api + work with sniro conductor to improve "inventoryType" representation
189 validateSolution(asyncResponse);
190 ServiceInstance serviceInstance = execution.getGeneralBuildingBlock().getCustomer().getServiceSubscription().getServiceInstances().get(0);
192 log.debug("Processing sniro manager asyncronous response");
193 JSONObject response = new JSONObject(asyncResponse);
194 if(response.has(SOLUTIONS)){
195 JSONObject allSolutions = response.getJSONObject(SOLUTIONS);
196 if(allSolutions.has("placementSolutions")){
197 JSONArray placementSolutions = allSolutions.getJSONArray("placementSolutions");
198 for(int i = 0; i < placementSolutions.length(); i++){
199 JSONArray placements = placementSolutions.getJSONArray(i);
200 processPlacementSolution(serviceInstance, placements, i);
203 if(allSolutions.has("licenseSolutions")){
204 JSONArray licenseSolutions = allSolutions.getJSONArray("licenseSolutions");
205 if(licenseSolutions.length() > 0){
206 processLicenseSolution(serviceInstance, licenseSolutions);
210 throw new BpmnError(UNPROCESSABLE, "Sniro Managers response does not contain: " + SOLUTIONS);
213 execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
215 log.trace("Completed Sniro Homing Process Solution");
218 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
219 }catch(BadResponseException e){
221 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
224 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage());
229 * Builds the request information section for the homing/licensing request
233 private RequestInfo buildRequestInfo(String requestId, String timeout) throws Exception{
234 log.trace("Building request information");
235 RequestInfo requestInfo = new RequestInfo();
236 if(requestId != null){
237 String host = env.getProperty("mso.workflow.message.endpoint");
238 String callbackUrl = host + "/" + UriUtils.encodePathSegment("SNIROResponse", "UTF-8") + "/" + UriUtils.encodePathSegment(requestId, "UTF-8");
240 Duration d = Duration.parse(timeout);
242 requestInfo.setTransactionId(requestId);
243 requestInfo.setRequestId(requestId);
244 requestInfo.setCallbackUrl(callbackUrl);
245 requestInfo.setRequestType("create");
246 requestInfo.setTimeout(d.getSeconds());
249 throw new BpmnError(UNPROCESSABLE, "Request Context does not contain: requestId");
255 * Builds the request information section for the homing/licensing request
258 private ServiceInfo buildServiceInfo(ServiceInstance serviceInstance){
259 log.trace("Building service information");
260 ServiceInfo info = new ServiceInfo();
261 ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance();
262 if(isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())){
263 info.setServiceInstanceId(serviceInstance.getServiceInstanceId());
264 if(modelInfo.getServiceType() != null && modelInfo.getServiceType().length() > 0){ //temp solution
265 info.setServiceName(modelInfo.getServiceType());
267 if(modelInfo.getServiceRole() != null){
268 info.setServiceRole(modelInfo.getServiceRole());
270 info.setModelInfo(buildModelInfo(modelInfo));
272 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + MODEL_VERSION_ID + ", " + MODEL_INVARIANT_ID);
278 * Builds initial section of placement info for the homing/licensing request
281 private PlacementInfo buildPlacementInfo(Customer customer, RequestParameters requestParams){
282 PlacementInfo placementInfo = new PlacementInfo();
283 if(customer != null){
284 log.debug("Adding subscriber to placement information");
285 SubscriberInfo subscriber = new SubscriberInfo();
286 subscriber.setGlobalSubscriberId(customer.getGlobalCustomerId());
287 subscriber.setSubscriberName(customer.getSubscriberName());
288 subscriber.setSubscriberCommonSiteId(customer.getSubscriberCommonSiteId());
289 placementInfo.setSubscriberInfo(subscriber);
290 if(requestParams != null){
291 log.debug("Adding request parameters to placement information");
292 placementInfo.setRequestParameters(requestParams.toJsonString());
295 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "customer");
297 return placementInfo;
302 * Builds the placement demand list for the homing/licensing request
305 private List<Demand> buildPlacementDemands(ServiceInstance serviceInstance){
306 log.trace("Building placement information demands");
307 List<Demand> placementDemands = new ArrayList<Demand>();
309 List<AllottedResource> allottedResourceList = serviceInstance.getAllottedResources();
310 if(!allottedResourceList.isEmpty()){
311 log.debug("Adding allotted resources to placement demands list");
312 for(AllottedResource ar : allottedResourceList){
313 if(isBlank(ar.getId())){
314 ar.setId(UUID.randomUUID().toString());
316 Demand demand = buildDemand(ar.getId(), ar.getModelInfoAllottedResource());
317 addCandidates(ar, demand);
318 placementDemands.add(demand);
321 List<VpnBondingLink> vpnBondingLinkList = serviceInstance.getVpnBondingLinks();
322 if(!vpnBondingLinkList.isEmpty()){
323 log.debug("Adding vpn bonding links to placement demands list");
324 for(VpnBondingLink vbl:vpnBondingLinkList){
325 List<ServiceProxy> serviceProxyList = vbl.getServiceProxies();
326 for(ServiceProxy sp : serviceProxyList){
327 if(isBlank(sp.getId())){
328 sp.setId(UUID.randomUUID().toString());
330 Demand demand = buildDemand(sp.getId(), sp.getModelInfoServiceProxy());
331 addCandidates(sp, demand);
332 placementDemands.add(demand);
336 return placementDemands;
340 * Builds the license demand list for the homing/licensing request
343 private List<Demand> buildLicenseDemands(ServiceInstance serviceInstance){
344 log.trace("Building license information");
345 List<Demand> licenseDemands = new ArrayList<Demand>();
346 List<GenericVnf> vnfList = serviceInstance.getVnfs();
347 if(!vnfList.isEmpty()){
348 log.debug("Adding vnfs to license demands list");
349 for(GenericVnf vnf : vnfList){
350 Demand demand = buildDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf());
351 licenseDemands.add(demand);
354 return licenseDemands;
358 * Builds a single demand object
361 private Demand buildDemand(String id, ModelInfoMetadata metadata){
362 log.debug("Building demand for service or resource: " + id);
363 Demand demand = new Demand();
364 if(isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())){
365 demand.setServiceResourceId(id);
366 demand.setResourceModuleName(metadata.getModelInstanceName());
367 demand.setModelInfo(buildModelInfo(metadata));
369 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
375 * Builds the resource model info section
378 private ModelInfo buildModelInfo(ModelInfoMetadata metadata){
379 ModelInfo object = new ModelInfo();
380 String invariantUuid = metadata.getModelInvariantUuid();
381 String modelUuid = metadata.getModelUuid();
382 if(isNotBlank(invariantUuid) && isNotBlank(modelUuid)){
383 object.setModelInvariantId(invariantUuid);
384 object.setModelVersionId(modelUuid);
385 object.setModelName(metadata.getModelName());
386 object.setModelVersion(metadata.getModelVersion());
387 }else if(isNotBlank(invariantUuid)){
388 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_VERSION_ID);
390 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_INVARIANT_ID);
396 * Adds required, excluded, and existing candidates to a demand
399 private void addCandidates(SolutionCandidates candidates, Demand demand){
400 List<Candidate> required = candidates.getRequiredCandidates();
401 List<Candidate> excluded = candidates.getExcludedCandidates();
402 if(!required.isEmpty()){
403 List<org.onap.so.client.sniro.beans.Candidate> cans = new ArrayList<org.onap.so.client.sniro.beans.Candidate>();
404 for(Candidate c:required){
405 org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
406 can.setIdentifierType(c.getIdentifierType());
407 can.setIdentifiers(c.getIdentifiers());
408 can.setCloudOwner(c.getCloudOwner());
411 demand.setRequiredCandidates(cans);
413 if(!excluded.isEmpty()){
414 List<org.onap.so.client.sniro.beans.Candidate> cans = new ArrayList<org.onap.so.client.sniro.beans.Candidate>();
415 for(Candidate c:excluded){
416 org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
417 can.setIdentifierType(c.getIdentifierType());
418 can.setIdentifiers(c.getIdentifiers());
419 can.setCloudOwner(c.getCloudOwner());
422 demand.setExcludedCandidates(cans);
424 //TODO support existing candidates
428 * Processes the license solutions and sets to the corresponding generic vnf
431 private void processLicenseSolution(ServiceInstance serviceInstance, JSONArray licenseSolutions){
432 List<GenericVnf> vnfs = serviceInstance.getVnfs();
434 log.debug("Processing the license solution");
435 for(int i = 0; i < licenseSolutions.length(); i++){
436 JSONObject licenseSolution = licenseSolutions.getJSONObject(i);
437 for(GenericVnf vnf:vnfs){
438 if(licenseSolution.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())){
439 License license = new License();
440 JSONArray entitlementPools = licenseSolution.getJSONArray("entitlementPoolUUID");
441 List<String> entitlementPoolsList = jsonUtils.StringArrayToList(entitlementPools);
442 license.setEntitlementPoolUuids(entitlementPoolsList);
443 JSONArray licenseKeys = licenseSolution.getJSONArray("licenseKeyGroupUUID");
444 List<String> licenseKeysList = jsonUtils.StringArrayToList(licenseKeys);
445 license.setLicenseKeyGroupUuids(licenseKeysList);
447 vnf.setLicense(license);
454 * Processes a placement solution list then correlates and sets each placement solution
455 * to its corresponding resource
458 private void processPlacementSolution(ServiceInstance serviceInstance, JSONArray placements, int i){
459 List<VpnBondingLink> links = serviceInstance.getVpnBondingLinks();
460 List<AllottedResource> allottes = serviceInstance.getAllottedResources();
461 List<GenericVnf> vnfs = serviceInstance.getVnfs();
463 log.debug("Processing placement solution " + i+1);
464 for(int p = 0; p < placements.length(); p++){
465 JSONObject placement = placements.getJSONObject(p);
466 SolutionInfo solutionInfo = new SolutionInfo();
467 solutionInfo.setSolutionId(i + 1);
469 for(VpnBondingLink vbl:links){
470 List<ServiceProxy> proxies = vbl.getServiceProxies();
471 for(ServiceProxy sp:proxies){
472 if(placement.getString(SERVICE_RESOURCE_ID).equals(sp.getId())){
475 VpnBondingLink vblNew = (VpnBondingLink) SerializationUtils.clone(vbl);
476 vblNew.setVpnBondingLinkId(UUID.randomUUID().toString());
479 links.get(links.size() - 1).getServiceProxy(sp.getId()).setServiceInstance(setSolution(solutionInfo, placement));
481 sp.setServiceInstance(setSolution(solutionInfo, placement));
487 for(AllottedResource ar:allottes){
488 if(placement.getString(SERVICE_RESOURCE_ID).equals(ar.getId())){
489 ar.setParentServiceInstance(setSolution(solutionInfo, placement));
493 for(GenericVnf vnf:vnfs){
494 if(placement.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())){
495 ServiceInstance si = setSolution(solutionInfo, placement);
496 serviceInstance.setSolutionInfo(si.getSolutionInfo());
497 serviceInstance.getVnfs().add(si.getVnfs().get(0));
507 * Creates and sets necessary pojos with placement solution data for a given demand
510 private ServiceInstance setSolution(SolutionInfo solutionInfo, JSONObject placement){
511 log.debug("Mapping placement solution");
512 String invalidMessage = "Sniro Managers Response contains invalid: ";
514 JSONObject solution = placement.getJSONObject("solution");
515 String identifierType = solution.getString(IDENTIFIER_TYPE);
516 List<String> identifiersList = jsonUtils.StringArrayToList(solution.getJSONArray("identifiers").toString());
517 String identifierValue = identifiersList.get(0);
519 JSONArray assignments = placement.getJSONArray("assignmentInfo");
520 Map<String, String> assignmentsMap = jsonUtils.entryArrayToMap(assignments.toString(), "key", "value");
521 solutionInfo.setRehome(Boolean.parseBoolean(assignmentsMap.get("isRehome")));
522 String type = placement.getString(INVENTORY_TYPE);
524 ServiceInstance si = new ServiceInstance();
525 CloudRegion cloud = setCloud(assignmentsMap);
526 if(type.equals("service")){
527 if(identifierType.equals(CandidateType.SERVICE_INSTANCE_ID.toString())){
528 solutionInfo.setHomed(true);
529 si.setServiceInstanceId(identifierValue);
530 si.setOrchestrationStatus(OrchestrationStatus.CREATED);
531 cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId"));
532 if(assignmentsMap.containsKey("vnfHostName")){
533 log.debug("Resources has been homed to a vnf");
534 GenericVnf vnf = setVnf(assignmentsMap);
535 vnf.setCloudRegion(cloud);
536 si.getVnfs().add(vnf);
538 }else if(assignmentsMap.containsKey("primaryPnfName")){
539 log.debug("Resources has been homed to a pnf");
540 Pnf priPnf = setPnf(assignmentsMap, "primary");
541 priPnf.setCloudRegion(cloud);
542 si.getPnfs().add(priPnf);
543 if(assignmentsMap.containsKey("secondaryPnfName")){
544 Pnf secPnf = setPnf(assignmentsMap, "secondary");
545 secPnf.setCloudRegion(cloud);
546 si.getPnfs().add(secPnf);
550 log.debug(invalidMessage + IDENTIFIER_TYPE);
551 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
553 }else if(type.equals("cloud")){
554 if(identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())){
555 log.debug("Resources has been homed to a cloud region");
556 cloud.setLcpCloudRegionId(identifierValue);
557 solutionInfo.setHomed(false);
558 solutionInfo.setTargetedCloudRegion(cloud);
559 si.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
561 log.debug(invalidMessage + IDENTIFIER_TYPE);
562 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
565 log.debug(invalidMessage + INVENTORY_TYPE);
566 throw new BpmnError(UNPROCESSABLE, invalidMessage + INVENTORY_TYPE);
568 si.setSolutionInfo(solutionInfo);
573 * Sets the cloud data to a cloud region object
576 private CloudRegion setCloud(Map<String, String> assignmentsMap){
577 CloudRegion cloud = new CloudRegion();
578 cloud.setCloudOwner(assignmentsMap.get("cloudOwner"));
579 cloud.setCloudRegionVersion(assignmentsMap.get("aicVersion"));
580 cloud.setComplex(assignmentsMap.get("aicClli"));
585 * Sets the vnf data to a generic vnf object
588 private GenericVnf setVnf(Map<String, String> assignmentsMap){
589 GenericVnf vnf = new GenericVnf();
590 vnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
591 vnf.setVnfName(assignmentsMap.get("vnfHostName"));
592 vnf.setVnfId(assignmentsMap.get("vnfId"));
597 * Sets the pnf data to a pnf object
600 private Pnf setPnf(Map<String, String> assignmentsMap, String role){
603 pnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
604 pnf.setPnfName(assignmentsMap.get(role + "PnfName"));