import static org.onap.vid.controller.MsoController.SVC_INSTANCE_ID;
import static org.onap.vid.controller.MsoController.VNF_INSTANCE_ID;
import static org.onap.vid.controller.MsoController.WORKFLOW_ID;
+import static org.onap.vid.logging.Headers.PARTNER_NAME;
import static org.onap.vid.mso.MsoProperties.MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS;
import static org.onap.vid.mso.MsoProperties.MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE;
import static org.onap.vid.mso.MsoProperties.MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE;
import org.onap.vid.mso.rest.RequestWrapper;
import org.onap.vid.mso.rest.Task;
import org.onap.vid.mso.rest.TaskList;
+import org.onap.vid.properties.Features;
import org.onap.vid.utils.Logging;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
+import org.togglz.core.manager.FeatureManager;
public class MsoBusinessLogicImpl implements MsoBusinessLogic {
*/
private final MsoInterface msoClientInterface;
+
+ private final FeatureManager featureManager;
+
@Autowired
- public MsoBusinessLogicImpl(MsoInterface msoClientInterface) {
+ public MsoBusinessLogicImpl(MsoInterface msoClientInterface, FeatureManager featureManager) {
this.msoClientInterface = msoClientInterface;
+ this.featureManager = featureManager;
}
public static String validateEndpointPath(String endpointEnvVariable) {
public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) {
logInvocationInDebug("createSvcInstance");
- String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String endpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
return msoClientInterface.createSvcInstance(msoRequest, endpoint);
}
UUID requestId = UUID.randomUUID();
extraHeaders.put("X-ONAP-RequestID",requestId.toString());
- extraHeaders.put("X-ONAP-PartnerName","VID");
+ extraHeaders.put(PARTNER_NAME.getHeaderName(), PARTNER_NAME.getHeaderValue());
extraHeaders.put("X-RequestorID",userId);
return msoClientInterface.invokeWorkflow(request,final_endpoint,extraHeaders);
logInvocationInDebug("deleteSvcInstance");
String endpoint;
- endpoint = validateEndpointPath(MsoProperties.MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE);
+ endpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
if (shouldUnassignService(serviceStatus)){
logger.debug(EELFLoggerDelegate.debugLogger, "unassign service");
String svcEndpoint = endpoint + "/" + serviceInstanceId + "/unassign";
return dashboardOrchestrationReqs;
}
+ private String simpleNoTaskInfoFilter()
+ {
+ if (featureManager.isActive(Features.FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD)) {
+ return "format=simpleNoTaskInfo&";
+ }
+
+ return "";
+
+ }
+
private String constructOrchestrationRequestFilter(String filterName, String filterValue) {
- return String.format("%sfilter=%s:EQUALS:%s",
- SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS), filterName, filterValue);
+
+ return String.format("%s%sfilter=%s:EQUALS:%s",
+ SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS),simpleNoTaskInfoFilter(), filterName, filterValue);
}
private List<RequestWrapper> getOrchestrationRequestsByFilter(String filterName, String filterValue) {
String methodName = "activateServiceInstance";
logInvocationInDebug(methodName);
try {
- String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
String activateServicePath = serviceEndpoint + "/" + serviceInstanceId + ACTIVATE;
RestObject<String> restObjStr = new RestObject<>();
@Override
public String getActivateFabricConfigurationPath(String serviceInstanceId) {
- String path = validateEndpointPath(MsoProperties.MSO_REST_API_SERVICE_INSTANCE_CREATE);
+ String path = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
path += "/" + serviceInstanceId + ACTIVATE_FABRIC_CONFIGURATION;
return path;
logInvocationInDebug("setServiceInstanceStatus");
String methodName = "setServiceInstanceStatus";
try {
- String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
String endpoint = serviceEndpoint + "/" + serviceInstanceId;
String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE);
public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) {
logInvocationInDebug("removeRelationshipFromServiceInstance");
- String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
String removeRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/removeRelationships";
return msoClientInterface.removeRelationshipFromServiceInstance(requestDetails, removeRelationshipsPath);
public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) {
logInvocationInDebug("addRelationshipToServiceInstance");
- String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE);
String addRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/addRelationships";
return msoClientInterface.addRelationshipToServiceInstance(requestDetails, addRelationshipsPath);