aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java24
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java70
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java36
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java40
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json57
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json434
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json13
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json6
23 files changed, 868 insertions, 73 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 68cfd487b3..bd60fbe38c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -71,6 +71,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
+import com.google.common.base.Strings;
@Component
public class AAICreateTasks {
@@ -184,24 +185,35 @@ public class AAICreateTasks {
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
OwningEntity owningEntity = serviceInstance.getOwningEntity();
- String owningEntityId = owningEntity.getOwningEntityId();
- String owningEntityName = owningEntity.getOwningEntityName();
- if (owningEntityId == null || "".equals(owningEntityId)) {
- String msg = "Exception in AAICreateOwningEntity. OwningEntityId is null.";
+ if (Strings.isNullOrEmpty(owningEntity.getOwningEntityId())
+ && Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
+ String msg = "Exception in AAICreateOwningEntity. OwningEntityId and Name are null.";
execution.setVariable("ErrorCreateOEAAI", msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ } else if (Strings.isNullOrEmpty(owningEntity.getOwningEntityId())
+ && !Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
+ if (aaiSIResources.existsOwningEntityName(owningEntity.getOwningEntityName())) {
+ org.onap.aai.domain.yang.OwningEntity aaiEntity =
+ aaiSIResources.getOwningEntityByName(owningEntity.getOwningEntityName());
+ owningEntity.setOwningEntityId(aaiEntity.getOwningEntityId());
+ owningEntity.setOwningEntityName(owningEntity.getOwningEntityName());
+ aaiSIResources.connectOwningEntityandServiceInstance(owningEntity, serviceInstance);
+ } else {
+ owningEntity.setOwningEntityId(UUID.randomUUID().toString());
+ aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance);
+ }
} else {
if (aaiSIResources.existsOwningEntity(owningEntity)) {
aaiSIResources.connectOwningEntityandServiceInstance(owningEntity, serviceInstance);
} else {
- if (owningEntityName == null || "".equals(owningEntityName)) {
+ if (Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
String msg =
"Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName.";
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue(), msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
} else {
- if (aaiSIResources.existsOwningEntityName(owningEntityName)) {
+ if (aaiSIResources.existsOwningEntityName(owningEntity.getOwningEntityName())) {
String msg =
"Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)";
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg,
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
index a436f7b5c2..9340609ffc 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
@@ -59,9 +59,18 @@ public class ExecuteActivity implements JavaDelegate {
private static final String VNF_ID = "vnfId";
private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
private static final String WORKFLOW_SYNC_ACK_SENT = "workflowSyncAckSent";
+ private static final String BUILDING_BLOCK = "buildingBlock";
+ private static final String EXECUTE_BUILDING_BLOCK = "ExecuteBuildingBlock";
+ private static final String RETRY_COUNT = "retryCount";
+ private static final String A_LA_CARTE = "aLaCarte";
+ private static final String SUPPRESS_ROLLBACK = "suppressRollback";
+ private static final String WORKFLOW_EXCEPTION = "WorkflowException";
+ private static final String HANDLING_CODE = "handlingCode";
+ private static final String ABORT_HANDLING_CODE = "Abort";
private static final String SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE = "implementation";
private static final String ACTIVITY_PREFIX = "activity:";
+ private static final String EXECUTE_ACTIVITY_ERROR_MESSAGE = "ExecuteActivityErrorMessage";
private ObjectMapper mapper = new ObjectMapper();
@@ -75,7 +84,8 @@ public class ExecuteActivity implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
final String requestId = (String) execution.getVariable(G_REQUEST_ID);
-
+ WorkflowException workflowException = null;
+ String handlingCode = null;
try {
Boolean workflowSyncAckSent = (Boolean) execution.getVariable(WORKFLOW_SYNC_ACK_SENT);
if (workflowSyncAckSent == null || workflowSyncAckSent == false) {
@@ -95,31 +105,44 @@ public class ExecuteActivity implements JavaDelegate {
ExecuteBuildingBlock executeBuildingBlock = buildExecuteBuildingBlock(execution, requestId, buildingBlock);
Map<String, Object> variables = new HashMap<>();
- variables.put("buildingBlock", executeBuildingBlock);
- variables.put(G_REQUEST_ID, requestId);
- variables.put("retryCount", 1);
- variables.put("aLaCarte", true);
- variables.put("suppressRollback", true);
- execution.getVariables().forEach((key, value) -> {
- if (value instanceof Serializable) {
- variables.put(key, (Serializable) value);
- }
- });
+ if (execution.getVariables() != null) {
+ execution.getVariables().forEach((key, value) -> {
+ if (value instanceof Serializable) {
+ variables.put(key, (Serializable) value);
+ }
+ });
+ }
+
+ variables.put(BUILDING_BLOCK, executeBuildingBlock);
+ variables.put(G_REQUEST_ID, requestId);
+ variables.put(RETRY_COUNT, 1);
+ variables.put(A_LA_CARTE, true);
+ variables.put(SUPPRESS_ROLLBACK, true);
ProcessInstanceWithVariables buildingBlockResult =
- runtimeService.createProcessInstanceByKey("ExecuteBuildingBlock").setVariables(variables)
+ runtimeService.createProcessInstanceByKey(EXECUTE_BUILDING_BLOCK).setVariables(variables)
.executeWithVariablesInReturn();
VariableMap variableMap = buildingBlockResult.getVariables();
- WorkflowException workflowException = (WorkflowException) variableMap.get("WorklfowException");
+ workflowException = (WorkflowException) variableMap.get(WORKFLOW_EXCEPTION);
if (workflowException != null) {
logger.error("Workflow exception is: {}", workflowException.getErrorMessage());
}
- execution.setVariable("WorkflowException", workflowException);
+
+ handlingCode = (String) variableMap.get(HANDLING_CODE);
+ logger.debug("Handling code: " + handlingCode);
+
+ execution.setVariable(WORKFLOW_EXCEPTION, workflowException);
} catch (Exception e) {
buildAndThrowException(execution, e.getMessage());
}
+
+ if (workflowException != null && handlingCode != null && handlingCode.equals(ABORT_HANDLING_CODE)) {
+ logger.debug("Aborting execution of the custom workflow");
+ buildAndThrowException(execution, workflowException.getErrorMessage());
+ }
+
}
protected BuildingBlock buildBuildingBlock(String activityName) {
@@ -161,7 +184,7 @@ public class ExecuteActivity implements JavaDelegate {
protected void buildAndThrowException(DelegateExecution execution, String msg) {
logger.error(msg);
- execution.setVariable("ExecuteActuvityErrorMessage", msg);
+ execution.setVariable(EXECUTE_ACTIVITY_ERROR_MESSAGE, msg);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index 9396f9dbfc..4285e9aa84 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -47,6 +47,7 @@ import static org.apache.commons.lang3.StringUtils.*;
@Component
public class VnfAdapterCreateTasks {
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class);
public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_";
private static final String VNFREST_REQUEST = "VNFREST_Request";
@@ -85,7 +86,9 @@ public class VnfAdapterCreateTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BBObjectNotFoundException bbException) {
- // If there is not a vf module in the general building block (in aLaCarte case), we will not retrieve
+ logger.error("Exception occurred", bbException);
+ // If there is not a vf module in the general building block (in aLaCarte case),
+ // we will not retrieve
// the SDNCQueryResponse and proceed as normal without throwing an error
}
@@ -94,6 +97,7 @@ public class VnfAdapterCreateTasks {
genericVnf, volumeGroup, sdncVfModuleQueryResponse);
execution.setVariable(VNFREST_REQUEST, createVolumeGroupRequest.toXmlString());
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -117,6 +121,8 @@ public class VnfAdapterCreateTasks {
try {
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
} catch (BBObjectNotFoundException bbException) {
+ logger.error("Exception occurred if bb objrct not found in VnfAdapterCreateTasks createVfModule ",
+ bbException);
}
CloudRegion cloudRegion = gBBInput.getCloudRegion();
RequestContext requestContext = gBBInput.getRequestContext();
@@ -129,9 +135,9 @@ public class VnfAdapterCreateTasks {
volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString());
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
-
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
index eddcc94e71..127d21c0ed 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
@@ -23,8 +23,12 @@
package org.onap.so.bpmn.infrastructure.appc.tasks;
import java.util.HashMap;
+import java.util.List;
import java.util.Optional;
import org.onap.so.logger.LoggingAnchor;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.appc.client.lcm.model.Action;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -33,9 +37,14 @@ import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.Relationships;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.appc.ApplicationControllerAction;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.logger.ErrorCode;
@@ -59,6 +68,8 @@ public class AppcRunTasks {
private CatalogDbClient catalogDbClient;
@Autowired
private ApplicationControllerAction appCClient;
+ @Autowired
+ private AAIVnfResources aaiVnfResources;
public void preProcessActivity(BuildingBlockExecution execution) {
execution.setVariable("actionSnapshot", Action.Snapshot);
@@ -78,6 +89,22 @@ public class AppcRunTasks {
execution.setVariable(ROLLBACK_VNF_STOP, false);
execution.setVariable(ROLLBACK_VNF_LOCK, false);
execution.setVariable(ROLLBACK_QUIESCE_TRAFFIC, false);
+ execution.setVariable("vmIdList", null);
+ execution.setVariable("vserverIdList", null);
+
+ GenericVnf vnf = null;
+ try {
+ vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ } catch (BBObjectNotFoundException e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "No valid VNF exists");
+ }
+
+ try {
+ getVserversForAppc(execution, vnf);
+ } catch (Exception e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Unable to retrieve vservers");
+ }
+
}
public void runAppcCommand(BuildingBlockExecution execution, Action action) {
@@ -155,7 +182,7 @@ public class AppcRunTasks {
}
protected void mapRollbackVariables(BuildingBlockExecution execution, Action action, String appcCode) {
- if (appcCode.equals("0") && action != null) {
+ if (appcCode != null && appcCode.equals("0") && action != null) {
if (action.equals(Action.Lock)) {
execution.setVariable(ROLLBACK_VNF_LOCK, true);
} else if (action.equals(Action.Unlock)) {
@@ -184,4 +211,45 @@ public class AppcRunTasks {
payloadInfo.put("vfModuleId", vfModuleId);
return payloadInfo;
}
+
+ protected void getVserversForAppc(BuildingBlockExecution execution, GenericVnf vnf) throws Exception {
+ AAIResultWrapper aaiRW = aaiVnfResources.queryVnfWrapperById(vnf);
+
+ if (aaiRW != null && aaiRW.getRelationships() != null && aaiRW.getRelationships().isPresent()) {
+ Relationships relationships = aaiRW.getRelationships().get();
+ if (relationships != null) {
+ List<AAIResourceUri> vserverUris = relationships.getRelatedAAIUris(AAIObjectType.VSERVER);
+ JSONArray vserverIds = new JSONArray();
+ JSONArray vserverSelfLinks = new JSONArray();
+ if (vserverUris != null) {
+ for (AAIResourceUri j : vserverUris) {
+ if (j != null) {
+ if (j.getURIKeys() != null) {
+ String vserverId = j.getURIKeys().get("vserver-id");
+ vserverIds.put(vserverId);
+ }
+ Optional<Vserver> oVserver = aaiVnfResources.getVserver(j);
+ if (oVserver.isPresent()) {
+ Vserver vserver = oVserver.get();
+ if (vserver != null) {
+ String vserverSelfLink = vserver.getVserverSelflink();
+ vserverSelfLinks.put(vserverSelfLink);
+ }
+ }
+ }
+ }
+ }
+
+ JSONObject vmidsArray = new JSONObject();
+ JSONObject vserveridsArray = new JSONObject();
+ vmidsArray.put("vmIds", vserverSelfLinks.toString());
+ vserveridsArray.put("vserverIds", vserverIds.toString());
+ logger.debug("vmidsArray is: {}", vmidsArray.toString());
+ logger.debug("vserveridsArray is: {}", vserveridsArray.toString());
+
+ execution.setVariable("vmIdList", vmidsArray.toString());
+ execution.setVariable("vserverIdList", vserveridsArray.toString());
+ }
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
index 7466df53b2..c9a937b824 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
@@ -30,8 +30,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -61,10 +59,10 @@ public class UnassignNetworkBB {
* @param execution - BuildingBlockExecution
* @param relatedToValue - String, ex: vf-module
* @return void - nothing
- * @throws Exception
+ *
*/
- public void checkRelationshipRelatedTo(BuildingBlockExecution execution, String relatedToValue) throws Exception {
+ public void checkRelationshipRelatedTo(BuildingBlockExecution execution, String relatedToValue) {
try {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
@@ -85,10 +83,10 @@ public class UnassignNetworkBB {
*
* @param execution - BuildingBlockExecution
* @return void - nothing
- * @throws Exception
+ *
*/
- public void getCloudSdncRegion(BuildingBlockExecution execution) throws Exception {
+ public void getCloudSdncRegion(BuildingBlockExecution execution) {
try {
String cloudRegionSdnc = networkBBUtils.getCloudRegion(execution, SourceSystem.SDNC);
execution.setVariable("cloudRegionSdnc", cloudRegionSdnc);
@@ -107,7 +105,7 @@ public class UnassignNetworkBB {
String msg;
boolean isRollbackNeeded =
execution.getVariable("isRollbackNeeded") != null ? execution.getVariable("isRollbackNeeded") : false;
- if (isRollbackNeeded == true) {
+ if (isRollbackNeeded) {
msg = execution.getVariable("ErrorUnassignNetworkBB") + messageErrorRollback;
} else {
msg = execution.getVariable("ErrorUnassignNetworkBB");
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index 1dcdfa912c..b8f5c8629d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -96,6 +96,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.SERVICE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -117,7 +118,6 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
-
GenericResourceApiVnfOperationInformation req =
sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext,
Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest));
@@ -125,10 +125,12 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+
/**
* BPMN access method to assigning the vfModule in SDNC.
*
@@ -160,6 +162,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
index 7478479a86..080d6d34b1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
@@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
- * This class is used for quering the SDNC
+ * This class is used for querying the SDNC.
*/
@Component
public class SDNCQueryTasks {
@@ -78,16 +78,19 @@ public class SDNCQueryTasks {
String response = sdncVnfResources.queryVnf(genericVnf);
execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response);
} catch (BadResponseException ex) {
+ logger.error("Exception occurred", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
} else {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
}
+
/**
* BPMN access method to query the SDNC for fetching the VfModule details.
*
@@ -116,12 +119,14 @@ public class SDNCQueryTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BadResponseException ex) {
+ logger.error("Exception occurred for BadResponse ", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
} else {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -144,20 +149,26 @@ public class SDNCQueryTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BBObjectNotFoundException bbException) {
- // If there is not a vf module in the general building block, we will not call SDNC and proceed as normal
+ logger.error("Error occurred if bb object not found in SDNCQueryTasks queryVfModuleForVolumeGroup ",
+ bbException);
+ // If there is not a vf module in the general building block, we will not call
+ // SDNC and proceed as normal
// without throwing an error
- // If we see a bb object not found exception for something that is not a vf module id, then we should throw
+ // If we see a bb object not found exception for something that is not a vf
+ // module id, then we should throw
// the error as normal
if (!ResourceKey.VF_MODULE_ID.equals(bbException.getResourceKey())) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, TargetEntity.SO);
}
} catch (BadResponseException ex) {
+ logger.error("Error occurred for BadResponseException in SDNCQueryTasks queryVfModuleForVolumeGroup ", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
} else {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
index fc3f2aec7a..52d294955a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
@@ -23,10 +23,10 @@ package org.onap.so.bpmn.infrastructure.validations;
import java.util.Optional;
import java.util.regex.Pattern;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.Skip;
import org.onap.so.bpmn.common.listener.validation.PreBuildingBlockValidator;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.listener.Skip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
index 7eaf011c75..8822bc39dd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
@@ -55,7 +55,6 @@ public class OrchestrationStatusValidator {
private static final String MULTI_STAGE_DESIGN_OFF = "false";
private static final String MULTI_STAGE_DESIGN_ON = "true";
-
@Autowired
private ExtractPojosForBB extractPojosForBB;
@Autowired
@@ -63,6 +62,7 @@ public class OrchestrationStatusValidator {
@Autowired
private CatalogDbClient catalogDbClient;
+
/**
* This method validate's the status of the OrchestrationStatus against the buildingBlockDetail ResourceType
*
@@ -137,7 +137,8 @@ public class OrchestrationStatusValidator {
OrchestrationStatusValidationDirective.VALIDATION_SKIPPED);
return;
default:
- // can't currently get here, so not tested. Added in case enum is expanded without a change to this
+ // can't currently get here, so not tested. Added in case enum is expanded
+ // without a change to this
// code
throw new OrchestrationStatusValidationException(
String.format(UNKNOWN_RESOURCE_TYPE, buildingBlockFlowName,
@@ -172,6 +173,9 @@ public class OrchestrationStatusValidator {
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT,
orchestrationStatusStateTransitionDirective.getFlowDirective());
} catch (BBObjectNotFoundException ex) {
+ logger.error(
+ "Error occurred for bb object notfound in OrchestrationStatusValidator validateOrchestrationStatus ",
+ ex);
if (execution.getFlowToBeCalled().contains("Unassign")) {
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT,
OrchestrationStatusValidationDirective.SILENT_SUCCESS);
@@ -179,6 +183,7 @@ public class OrchestrationStatusValidator {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex);
}
} catch (Exception e) {
+ logger.error("Exception occurred", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index f23e5cdb5a..5c69987a54 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -33,6 +33,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.apache.commons.lang3.StringUtils;
@@ -210,23 +211,25 @@ public class VnfAdapterVfModuleObjectMapper {
protected void buildDirectivesParamFromMap(Map<String, Object> paramsMap, String directive,
Map<String, Object> srcMap) throws MissingValueTagException {
StringBuilder directives = new StringBuilder();
- int no_directives_size = 0;
+ int noOfDirectivesSize = 0;
if (directive.equals(MsoMulticloudUtils.USER_DIRECTIVES)
&& srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) {
- no_directives_size = 1;
+ noOfDirectivesSize = 1;
}
- if (srcMap.size() > no_directives_size) {
+ if (srcMap.size() > noOfDirectivesSize) {
directives.append("{ \"attributes\": [ ");
int i = 0;
- for (String attributeName : srcMap.keySet()) {
+ for (Map.Entry<String, Object> attributeEntry : srcMap.entrySet()) {
+ String attributeName = attributeEntry.getKey();
+ Object attributeValue = attributeEntry.getValue();
if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directive)
&& attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) {
- if (srcMap.get(attributeName) == null) {
+ if (attributeValue == null) {
logger.error("No value tag found for attribute: {}", attributeName);
throw new MissingValueTagException("No value tag found for " + attributeName);
}
- directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
- if (i < (srcMap.size() - 1 + no_directives_size))
+ directives.append(new AttributeNameValue(attributeName, attributeValue.toString()));
+ if (i < (srcMap.size() - 1 + noOfDirectivesSize))
directives.append(", ");
i++;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java
new file mode 100644
index 0000000000..5f65e5d76d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java
@@ -0,0 +1,16 @@
+package org.onap.so.client.orchestration;
+
+public class AAIEntityNotFoundException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -107868951852460677L;
+
+ public AAIEntityNotFoundException(String error) {
+ super(error);
+ }
+
+
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
index c41f3fa56c..fc1528526c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
@@ -22,7 +22,9 @@
package org.onap.so.client.orchestration;
+import java.util.List;
import java.util.Optional;
+import org.onap.aai.domain.yang.OwningEntities;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
@@ -120,6 +122,25 @@ public class AAIServiceInstanceResources {
return aaiRC.exists(owningEntityUri);
}
+ public org.onap.aai.domain.yang.OwningEntity getOwningEntityByName(String owningEntityName)
+ throws AAIEntityNotFoundException {
+ AAIResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+ .queryParam("owning-entity-name", owningEntityName);
+ AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
+ Optional<OwningEntities> owningEntities = aaiRC.get(OwningEntities.class, owningEntityUri);
+ if (owningEntities.isPresent()) {
+ List<org.onap.aai.domain.yang.OwningEntity> owningEntityList = owningEntities.get().getOwningEntity();
+ if (owningEntityList.size() > 1) {
+ throw new AAIEntityNotFoundException(
+ "Non unique result returned for owning entity name: " + owningEntityName);
+ } else {
+ return owningEntityList.get(0);
+ }
+ } else {
+ throw new AAIEntityNotFoundException("No result returned for owning entity name: " + owningEntityName);
+ }
+ }
+
public void connectOwningEntityandServiceInstance(OwningEntity owningEntity, ServiceInstance serviceInstance) {
AAIResourceUri owningEntityURI =
AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntity.getOwningEntityId());
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
index a9635d1e34..63bde79b3f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
@@ -24,6 +24,7 @@ package org.onap.so.client.orchestration;
import java.io.IOException;
import java.util.Optional;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -37,9 +38,8 @@ import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -160,4 +160,14 @@ public class AAIVnfResources {
AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
return injectionHelper.getAaiClient().exists(vnfUri);
}
+
+ public AAIResultWrapper queryVnfWrapperById(GenericVnf vnf) {
+ AAIResourceUri uri =
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()).depth(Depth.ALL);
+ return injectionHelper.getAaiClient().get(uri);
+ }
+
+ public Optional<Vserver> getVserver(AAIResourceUri uri) {
+ return injectionHelper.getAaiClient().get(uri).asBean(Vserver.class);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
index 12d1b0be95..b8146b5504 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
@@ -36,7 +36,7 @@ public class SDNCRequest implements Serializable {
private SDNCTopology topology;
private String correlationValue = UUID.randomUUID().toString();
private String correlationName = "SDNCCallback";
- private Object SDNCPayload;
+ private Object sdncPayload;
public String getTimeOut() {
@@ -72,11 +72,11 @@ public class SDNCRequest implements Serializable {
}
public Object getSDNCPayload() {
- return SDNCPayload;
+ return sdncPayload;
}
public void setSDNCPayload(Object sDNCPayload) {
- SDNCPayload = sDNCPayload;
+ this.sdncPayload = sDNCPayload;
}
@Override
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
index 21c0b971b8..d07574a1ad 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
@@ -57,10 +57,10 @@ public class SniroClient {
*
* @param homingRequest
* @return
- * @throws JsonProcessingException
+ * @throws BadResponseException
* @throws BpmnError
*/
- public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException, JsonProcessingException {
+ public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException {
logger.trace("Started Sniro Client Post Demands");
String url = managerProperties.getHost() + managerProperties.getUri().get("v2");
logger.debug("Post demands url: {}", url);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index ed3ec759c3..a8550d8df9 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -54,16 +54,16 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
public class AAICreateTasksTest extends BaseTaskTest {
@@ -272,24 +272,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createOwningEntityNullOwningEntityIdTest() throws Exception {
- expectedException.expect(BpmnError.class);
-
- serviceInstance.getOwningEntity().setOwningEntityId(null);
-
- aaiCreateTasks.createOwningEntity(execution);
- }
-
- @Test
- public void createOwningEntityEmptyOwningEntityIdTest() throws Exception {
- expectedException.expect(BpmnError.class);
-
- serviceInstance.getOwningEntity().setOwningEntityId("");
-
- aaiCreateTasks.createOwningEntity(execution);
- }
-
- @Test
public void createOwningEntityNullOwningEntityNameTest() throws Exception {
expectedException.expect(BpmnError.class);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
index e7a8b35db8..8328e0e08b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
@@ -19,11 +19,17 @@
*/
package org.onap.so.bpmn.infrastructure.appc.tasks;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Optional;
import java.util.UUID;
@@ -39,6 +45,8 @@ import org.springframework.beans.factory.annotation.Autowired;
public class AppcRunTasksIT extends BaseIntegrationTest {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
@Autowired
private AppcRunTasks appcRunTasks;
@@ -56,8 +64,51 @@ public class AppcRunTasksIT extends BaseIntegrationTest {
}
@Test
- public void preProcessActivityTest() throws Exception {
+ public void preProcessActivityWithVserversTest() throws Exception {
+ final String aaiVnfJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/v15/network/generic-vnfs/generic-vnf/testVnfId1?depth=all")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody(aaiVnfJson).withStatus(200)));
+
+ final String aaiVserverJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverFullQueryResponse.json")));
+ wireMockServer.stubFor(get(urlEqualTo(
+ "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+ wireMockServer.stubFor(get(urlEqualTo(
+ "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+ wireMockServer.stubFor(get(urlEqualTo(
+ "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+
+ appcRunTasks.preProcessActivity(execution);
+ String vserverIdList = execution.getVariable("vserverIdList");
+ String expectedVserverIdList =
+ "{\"vserverIds\":\"[\\\"1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5\\\",\\\"14551849-1e70-45cd-bc5d-a256d49548a2\\\",\\\"48bd7f11-408f-417c-b834-b41c1b98f7d7\\\"]\"}";
+ String vmIdList = execution.getVariable("vmIdList");
+ String expectedVmIdList =
+ "{\"vmIds\":\"[\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\"]\"}";
+
+ assertEquals(vserverIdList, expectedVserverIdList);
+ assertEquals(vmIdList, expectedVmIdList);
+ assertEquals(execution.getVariable("actionQuiesceTraffic"), Action.QuiesceTraffic);
+ assertEquals(execution.getVariable("rollbackQuiesceTraffic"), false);
+ }
+
+ @Test
+ public void preProcessActivityNoVserversTest() throws Exception {
+ final String aaiVnfJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnf.json")));
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/v15/network/generic-vnfs/generic-vnf/testVnfId1?depth=all")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody(aaiVnfJson).withStatus(200)));
appcRunTasks.preProcessActivity(execution);
+ assertNull(execution.getVariable("vmIdList"));
+ assertNull(execution.getVariable("vServerIdList"));
assertEquals(execution.getVariable("actionQuiesceTraffic"), Action.QuiesceTraffic);
assertEquals(execution.getVariable("rollbackQuiesceTraffic"), false);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
index cf673c5eb5..cc25689358 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
@@ -26,12 +26,17 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Optional;
import org.junit.Test;
import org.mockito.InjectMocks;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.appc.client.lcm.model.Action;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -39,11 +44,16 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
public class AppcRunTasksTest extends BaseTaskTest {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
@InjectMocks
private AppcRunTasks appcRunTasks = new AppcRunTasks();
@@ -132,6 +142,32 @@ public class AppcRunTasksTest extends BaseTaskTest {
assertEquals(true, execution.getVariable("rollbackVnfLock"));
}
+ @Test
+ public void getVserversForAppcTest() throws Exception {
+
+ GenericVnf genericVnf = getTestGenericVnf();
+
+ final String aaiVnfJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
+ final String aaiVserverJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json")));
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiVnfJson);
+ ObjectMapper mapper = new ObjectMapper();
+ Vserver vserver = mapper.readValue(aaiVserverJson, Vserver.class);
+ doReturn(aaiResultWrapper).when(aaiVnfResources).queryVnfWrapperById(genericVnf);
+ doReturn(Optional.of(vserver)).when(aaiVnfResources).getVserver(any(AAIResourceUri.class));
+ appcRunTasks.getVserversForAppc(execution, genericVnf);
+ String vserverIdList = execution.getVariable("vserverIdList");
+ String expectedVserverIdList =
+ "{\"vserverIds\":\"[\\\"1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5\\\",\\\"14551849-1e70-45cd-bc5d-a256d49548a2\\\",\\\"48bd7f11-408f-417c-b834-b41c1b98f7d7\\\"]\"}";
+ String vmIdList = execution.getVariable("vmIdList");
+ String expectedVmIdList =
+ "{\"vmIds\":\"[\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\"]\"}";
+
+ assertEquals(vserverIdList, expectedVserverIdList);
+ assertEquals(vmIdList, expectedVmIdList);
+ }
+
private void mockReferenceResponse() {
ControllerSelectionReference reference = new ControllerSelectionReference();
reference.setControllerName("TEST-CONTROLLER-NAME");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
index 0d48a29ca9..3680eaac81 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
@@ -20,8 +20,10 @@
package org.onap.so.client.orchestration;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -31,6 +33,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
@@ -54,11 +58,14 @@ import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
@RunWith(MockitoJUnitRunner.Silent.class)
public class AAIVnfResourcesTest extends TestDataSetup {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
private GenericVnf genericVnf;
private ServiceInstance serviceInstance;
@@ -249,4 +256,37 @@ public class AAIVnfResourcesTest extends TestDataSetup {
boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName");
assertFalse(nameInUse);
}
+
+ @Test
+ public void queryVnfWrapperByIdTest() throws Exception {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "vnfId").depth(Depth.ALL);
+ final String aaiResponse = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnf.json")));
+ GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId("vnfId");
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiResponse);
+ doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(eq(uri));
+ AAIResultWrapper actualResult = aaiVnfResources.queryVnfWrapperById(genericVnf);
+ assertEquals(actualResult, aaiResultWrapper);
+
+ }
+
+ @Test
+ public void getVserverTest() throws Exception {
+ final String content =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json")));
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(content);
+ Optional<org.onap.aai.domain.yang.Vserver> oVserver = Optional.empty();
+ AAIResourceUri vserverUri = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, "ModelInvariantUUID",
+ "serviceModelVersionId", "abc", "abc");
+
+ doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(isA(AAIResourceUri.class));
+ oVserver = aaiVnfResources.getVserver(vserverUri);
+
+ verify(MOCK_aaiResourcesClient, times(1)).get(any(AAIResourceUri.class));
+
+ if (oVserver.isPresent()) {
+ org.onap.aai.domain.yang.Vserver vserver = oVserver.get();
+ assertThat(aaiResultWrapper.asBean(org.onap.aai.domain.yang.Vserver.class).get(), sameBeanAs(vserver));
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json
new file mode 100644
index 0000000000..e997db3f69
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json
@@ -0,0 +1,57 @@
+{
+ "closedLoopDisabled":false,
+ "vnf-id":"vnfId1",
+ "vnf-name":"vnfName",
+ "vnf-type":"vnfType",
+ "orchestration-status":"PRECREATED",
+ "vf-modules": {
+ "vf-module": [{
+ "vf-module-id": "lukewarm",
+ "vf-module-name": "testVfModuleNameGWPrim",
+ "heat-stack-id": "fastburn",
+ "is-base-vf-module": true,
+ "orchestration-status": "Created"
+ },
+ {
+ "vf-module-id": "testVfModuleIdGWSec",
+ "vf-module-name": "testVfModuleNameGWSec",
+ "heat-stack-id": "testHeatStackIdGWSec",
+ "orchestration-status": "Created"
+ }]
+ },
+ "volume-groups":[],
+ "line-of-business":null,
+ "platform":null,
+ "cascaded":false,
+ "cloud-params":{},
+ "cloud-context":null,
+ "solution":null,
+ "vnf-name-2":null,
+ "service-id":null,
+ "regional-resource-zone":null,
+ "prov-status":null,
+ "operational-status":null,
+ "equipment-role":null,
+ "management-option":null,
+ "ipv4-oam-address":null,
+ "ipv4-loopback0-address":null,
+ "nm-lan-v6-address":null,
+ "management-v6-address":null,
+ "vcpu":null,
+ "vcpu-units":null,
+ "vmemory":null,
+ "vmemory-units":null,
+ "vdisk":null,
+ "vdisk-units":null,
+ "in-maint":false,
+ "is-closed-loop-disabled":false,
+ "summary-status":null,
+ "encrypted-access-flag":null,
+ "as-number":null,
+ "regional-resource-subzone":null,
+ "self-link":null,
+ "ipv4-oam-gateway-address":null,
+ "ipv4-oam-gateway-address-prefix-length":null,
+ "vlan-id-outer":null,"nm-profile-name":null,
+ "model-info-generic-vnf":null
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json
new file mode 100644
index 0000000000..0ad0f054b0
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json
@@ -0,0 +1,434 @@
+{
+ "vnf-id": "example-vnf-id-val-90603",
+ "vnf-name": "example-vnf-name-val-56838",
+ "vnf-name2": "example-vnf-name2-val-56319",
+ "vnf-type": "example-vnf-type-val-30533",
+ "service-id": "example-service-id-val-28290",
+ "regional-resource-zone": "example-regional-resource-zone-val-11059",
+ "prov-status": "example-prov-status-val-59777",
+ "operational-status": "example-operational-status-val-22513",
+ "in-maint": true,
+
+ "equipment-role": "example-equipment-role-val-23396",
+ "orchestration-status": "example-orchestration-status-val-59435",
+ "heat-stack-id": "example-heat-stack-id-val-96869",
+ "mso-catalog-key": "example-mso-catalog-key-val-30721",
+ "management-option": "example-management-option-val-61927",
+ "ipv4-oam-address": "192.168.10.14",
+ "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-87072",
+ "nm-lan-v6-address": "example-nm-lan-v6-address-val-91063",
+ "management-v6-address": "example-management-v6-address-val-80466",
+ "vcpu": 45837298,
+ "vcpu-units": "example-vcpu-units-val-86249",
+ "vmemory": 57288956,
+ "vmemory-units": "example-vmemory-units-val-13291",
+ "vdisk": 16937143,
+ "vdisk-units": "example-vdisk-units-val-73197",
+
+ "is-closed-loop-disabled": true,
+ "summary-status": "example-summary-status-val-86438",
+ "encrypted-access-flag": true,
+
+
+
+
+ "model-invariant-id": "example-model-invariant-id-val-14704",
+ "model-version-id": "example-model-version-id-val-47847",
+ "model-customization-id": "example-model-customization-id-val-52688",
+ "widget-model-id": "example-widget-model-id-val-20939",
+ "widget-model-version": "example-widget-model-version-val-72210",
+ "as-number": "example-as-number-val-68358",
+ "regional-resource-subzone": "example-regional-resource-subzone-val-34391",
+ "nf-type": "example-nf-type-val-54866",
+ "nf-function": "example-nf-function-val-24790",
+ "nf-role": "example-nf-role-val-4780",
+ "nf-naming-code": "example-nf-naming-code-val-25118",
+ "selflink": "example-selflink-val-68404",
+
+ "relationship-list": {"relationship": [
+ {
+ "related-to": "service-instance",
+ "relationship-label": "org.onap.relationships.inventory.ComposedOf",
+ "related-link": "/aai/v12/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/2c323333-af4f-4849-af03-c862c0e93e3b",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "e433710f-9217-458d-a79d-1c7aff376d89"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "VIRTUAL USP"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "2c323333-af4f-4849-af03-c862c0e93e3b"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "kjhgfd1"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm003"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "14551849-1e70-45cd-bc5d-a256d49548a2"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm002"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "48bd7f11-408f-417c-b834-b41c1b98f7d7"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm001"
+ }]
+ }
+ ]},
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-50593",
+ "interface-role": "example-interface-role-val-23375",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-5921",
+ "selflink": "example-selflink-val-75663",
+ "interface-id": "example-interface-id-val-37465",
+ "macaddr": "example-macaddr-val-62657",
+ "network-name": "example-network-name-val-7252",
+ "management-option": "example-management-option-val-32963",
+ "interface-description": "example-interface-description-val-89453",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-16684",
+ "vlan-id-inner": 8602916,
+ "vlan-id-outer": 97348542,
+ "speed-value": "example-speed-value-val-90330",
+ "speed-units": "example-speed-units-val-15849",
+ "vlan-description": "example-vlan-description-val-46942",
+ "backdoor-connection": "example-backdoor-connection-val-78445",
+
+ "orchestration-status": "example-orchestration-status-val-44994",
+
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-90277",
+ "l3-interface-ipv4-prefix-length": 3364150,
+ "vlan-id-inner": 44021171,
+ "vlan-id-outer": 55708677,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-43267",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-62870"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-45323",
+ "l3-interface-ipv6-prefix-length": 56688923,
+ "vlan-id-inner": 5703071,
+ "vlan-id-outer": 86682265,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-28366",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-53034"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-4720",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-42594",
+ "vf-mac-filter": "example-vf-mac-filter-val-13375",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-6057",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-81448",
+ "neutron-network-id": "example-neutron-network-id-val-9504"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-16738",
+ "interface-role": "example-interface-role-val-13943",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-63173",
+ "selflink": "example-selflink-val-43085",
+ "interface-id": "example-interface-id-val-51379",
+ "macaddr": "example-macaddr-val-16195",
+ "network-name": "example-network-name-val-45683",
+ "management-option": "example-management-option-val-78983",
+ "interface-description": "example-interface-description-val-34414",
+ "is-port-mirrored": true
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-99078",
+ "l3-interface-ipv4-prefix-length": 55755841,
+ "vlan-id-inner": 81525473,
+ "vlan-id-outer": 90908072,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-47919",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-84236"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-21939",
+ "l3-interface-ipv6-prefix-length": 50057584,
+ "vlan-id-inner": 75774660,
+ "vlan-id-outer": 4421090,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-46377",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-16585"
+ }
+ ]
+ }
+ ]
+ },
+ "lag-interfaces": {
+ "lag-interface": [
+ {
+ "interface-name": "example-interface-name-val-39234",
+ "interface-description": "example-interface-description-val-1037",
+ "speed-value": "example-speed-value-val-1929",
+ "speed-units": "example-speed-units-val-74937",
+ "interface-id": "example-interface-id-val-91265",
+ "interface-role": "example-interface-role-val-19613",
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-10722",
+ "interface-role": "example-interface-role-val-95194",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-24328",
+ "selflink": "example-selflink-val-24987",
+ "interface-id": "example-interface-id-val-75726",
+ "macaddr": "example-macaddr-val-36940",
+ "network-name": "example-network-name-val-65359",
+ "management-option": "example-management-option-val-49521",
+ "interface-description": "example-interface-description-val-70528",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-70827",
+ "vlan-id-inner": 55659612,
+ "vlan-id-outer": 90335612,
+ "speed-value": "example-speed-value-val-54761",
+ "speed-units": "example-speed-units-val-91398",
+ "vlan-description": "example-vlan-description-val-17018",
+ "backdoor-connection": "example-backdoor-connection-val-4021",
+
+ "orchestration-status": "example-orchestration-status-val-18315",
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-59336",
+ "l3-interface-ipv4-prefix-length": 57636053,
+ "vlan-id-inner": 34068397,
+ "vlan-id-outer": 48570286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-69862",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-75795"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-15038",
+ "l3-interface-ipv6-prefix-length": 42694503,
+ "vlan-id-inner": 15929806,
+ "vlan-id-outer": 87413856,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-52519",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-24471"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-44669",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-53436",
+ "vf-mac-filter": "example-vf-mac-filter-val-71902",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-54963",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-1546",
+ "neutron-network-id": "example-neutron-network-id-val-92159"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-9327",
+ "interface-role": "example-interface-role-val-21859",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-21445",
+ "selflink": "example-selflink-val-6085",
+ "interface-id": "example-interface-id-val-39854",
+ "macaddr": "example-macaddr-val-14433",
+ "network-name": "example-network-name-val-3722",
+ "management-option": "example-management-option-val-64739",
+ "interface-description": "example-interface-description-val-5814",
+ "is-port-mirrored": true
+
+
+
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-64531",
+ "l3-interface-ipv4-prefix-length": 66545882,
+ "vlan-id-inner": 12194134,
+ "vlan-id-outer": 29589286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-91108",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-56984"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-37408",
+ "l3-interface-ipv6-prefix-length": 5116459,
+ "vlan-id-inner": 39229896,
+ "vlan-id-outer": 15091934,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-87700",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-37352"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "example-vf-module-id-val-56249",
+ "vf-module-name": "example-vf-module-name-val-18987",
+ "heat-stack-id": "example-heat-stack-id-val-80110",
+ "orchestration-status": "example-orchestration-status-val-8226",
+ "is-base-vf-module": true,
+ "model-invariant-id": "example-model-invariant-id-val-5071",
+ "model-version-id": "example-model-version-id-val-80793",
+ "model-customization-id": "example-model-customization-id-val-83277",
+ "widget-model-id": "example-widget-model-id-val-99814",
+ "widget-model-version": "example-widget-model-version-val-22799",
+ "contrail-service-instance-fqdn": "example-contrail-service-instance-fqdn-val-52133",
+ "module-index": 1933,
+ "selflink": "example-selflink-val-69992"
+ }
+ ]
+ },
+ "licenses": {
+ "license": [
+ {
+ "group-uuid": "example-group-uuid-val-73012",
+ "resource-uuid": "example-resource-uuid-val-80045"
+ }
+ ]
+ },
+ "entitlements": {
+ "entitlement": [
+ {
+ "group-uuid": "example-group-uuid-val-14874",
+ "resource-uuid": "example-resource-uuid-val-49146"
+ }
+ ]
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json
new file mode 100644
index 0000000000..1c7e1fb970
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json
@@ -0,0 +1,13 @@
+{
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "linterfaces": null,
+ "prov-status": null,
+ "relationship-list": null,
+ "resource-version": null,
+ "volumes": null,
+ "vserver-id": "VServerId",
+ "vserver-name": "VServerName",
+ "vserver-name2": "VServerName2",
+ "vserver-selflink": "http://VSERVER-link.com"
+ } \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json
new file mode 100644
index 0000000000..eca735b810
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json
@@ -0,0 +1,6 @@
+{
+ "vserverId": "VServerId",
+ "vserverName": "VServerName",
+ "vserverName2": "VServerName2",
+ "vserverSelflink": "http://VSERVER-link.com"
+ } \ No newline at end of file