From d01c185ffbb1a41a4c9773ab416b04a0a770c2a2 Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Mon, 9 Sep 2019 21:18:19 +0300 Subject: update MSO create service instance URL align MSO create service instance URL to /serviceInstantiation/v7/serviceInstances also unify some system properties variables Issue-ID: VID-622 Signed-off-by: Eylon Malin Change-Id: I7a0744f5d6cfe776ce2f17b11aa5ebba4c8e65fb Signed-off-by: Eylon Malin --- .../main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java | 14 +++++++------- .../src/main/java/org/onap/vid/mso/MsoProperties.java | 8 +------- .../vid/services/AsyncInstantiationBusinessLogicImpl.java | 4 ++-- 3 files changed, 10 insertions(+), 16 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap') diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java index 4d0d4ee74..3d980dce8 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java @@ -140,7 +140,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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); } @@ -260,7 +260,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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"; @@ -470,7 +470,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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 restObjStr = new RestObject<>(); @@ -534,7 +534,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { @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; @@ -684,7 +684,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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); @@ -822,7 +822,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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); @@ -832,7 +832,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { 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); diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java index 4e6258c16..81566aae1 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java @@ -69,10 +69,7 @@ public class MsoProperties extends SystemProperties { public static final String MSO_REST_API_E2E_SVC_INSTANCE = "mso.restapi.svc.e2einstance"; // /e2eServiceInstances/v3 /** The Constant MSO_REST_API_SVC_INSTANCE. */ - public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2 - - /** The Constant MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE. */ - public static final String MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance.deleteAndUnassign"; + public static final String MSO_RESTAPI_SERVICE_INSTANCE = "mso.restapi.service.instance"; // /serviceInstances/v2 /** The Constant MSO_REST_API_VNF_INSTANCE. */ public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; @@ -120,9 +117,6 @@ public class MsoProperties extends SystemProperties { /** The Constant MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS */ public static final String MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS = "mso.restapi.operationalEnvironment.cloudResourcesRequests.status"; - /** The Constant MSO_REST_API_SERVICE_INSTANCE_CREATE */ - public static final String MSO_REST_API_SERVICE_INSTANCE_CREATE = "mso.restapi.serviceInstanceCreate"; - /** The Constant MSO_REST_API_SERVICE_INSTANCE_ASSIGN */ public static final String MSO_REST_API_SERVICE_INSTANCE_ASSIGN = "mso.restapi.serviceInstanceAssign"; diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java index d7b3ac602..c77eb8230 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java @@ -247,13 +247,13 @@ public class AsyncInstantiationBusinessLogicImpl implements //in case pause flag is true - use assign , else - use create. return MsoBusinessLogicImpl.validateEndpointPath( serviceInstantiationRequest.isPause() ? - MsoProperties.MSO_REST_API_SERVICE_INSTANCE_ASSIGN : MsoProperties.MSO_REST_API_SERVICE_INSTANCE_CREATE + MsoProperties.MSO_REST_API_SERVICE_INSTANCE_ASSIGN : MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE ); } @Override public String getServiceDeletionPath(String serviceInstanceId) { - return MsoBusinessLogicImpl.validateEndpointPath( MsoProperties.MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE) + "/" + serviceInstanceId; + return MsoBusinessLogicImpl.validateEndpointPath( MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE) + "/" + serviceInstanceId; } @Override -- cgit 1.2.3-korg