use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.
the class VnfAdapterDeleteTasks method deleteVfModule.
public void deleteVfModule(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
DeleteVfModuleRequest deleteVfModuleRequest = vnfAdapterVfModuleResources.deleteVfModuleRequest(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, genericVnf, vfModule);
execution.setVariable(VNFREST_REQUEST, deleteVfModuleRequest.toXmlString());
execution.setVariable("deleteVfModuleRequest", "true");
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.
the class NetworkAdapterImpl method preProcessNetworkAdapter.
public void preProcessNetworkAdapter(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
execution.setVariable("mso-request-id", gBBInput.getRequestContext().getMsoRequestId());
execution.setVariable("mso-service-instance-id", serviceInstance.getServiceInstanceId());
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.
the class VnfAdapterImpl method preProcessVnfAdapter.
public void preProcessVnfAdapter(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
execution.setVariable("mso-request-id", gBBInput.getRequestContext().getMsoRequestId());
execution.setVariable("mso-service-instance-id", serviceInstance.getServiceInstanceId());
execution.setVariable(HEAT_STACK_ID, null);
execution.setVariable(CONTRAIL_SERVICE_INSTANCE_FQDN, null);
execution.setVariable(OAM_MANAGEMENT_V4_ADDRESS, null);
execution.setVariable(OAM_MANAGEMENT_V6_ADDRESS, null);
execution.setVariable(CONTRAIL_NETWORK_POLICY_FQDN_LIST, null);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.
the class AAIDeleteTasks method deleteServiceInstance.
/**
* BPMN access method to delete the ServiceInstance from A&AI.
*
* It will extract the serviceInstance from the BBObject.
*
* @param execution
* @throws Exception
*/
public void deleteServiceInstance(BuildingBlockExecution execution) throws Exception {
try {
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiSIResources.deleteServiceInstance(serviceInstance);
} catch (Exception ex) {
logger.error("Exception occurred in AAIDeleteTasks deleteServiceInstance process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.
the class BuildingBlockTestDataSetup method setServiceInstance.
public ServiceInstance setServiceInstance() {
ServiceInstance serviceInstance = buildServiceInstance();
if (gBBInput.getCustomer() == null) {
gBBInput.setCustomer(buildCustomer());
}
gBBInput.getCustomer().getServiceSubscription().getServiceInstances().add(serviceInstance);
lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstance.getServiceInstanceId());
return serviceInstance;
}
Aggregations