summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java26
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java17
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java1
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java10
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java2
7 files changed, 56 insertions, 4 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java b/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java
index bbca06e9b..deebb2b70 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java
@@ -235,7 +235,31 @@ public class MsoController extends RestrictedBaseController {
return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
}
- /**
+ /**
+ * Delete E2e svc instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_e2e_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteE2eSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request, @RequestBody LinkedHashMap<String, Object> mso_request) throws Exception {
+
+ String methodName = "deleteE2eSvcInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteE2eSvcInstance(mso_request.get("requestDetails"), serviceInstanceId);
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ // always return OK, the MSO status code is embedded in the body
+
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
* Delete svc instance.
*
* @param serviceInstanceId the service instance id
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
index f38a7fc6d..80d60d9ca 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
@@ -18,6 +18,8 @@ public interface MsoBusinessLogic {
MsoResponseWrapper createE2eSvcInstance(Object msoRequest) throws Exception;
+ MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String serviceInstanceId) throws Exception;
+
MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
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 10ac231bf..7cea0301b 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
@@ -197,6 +197,23 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic {
}
@Override
+ public MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "deleteE2eSvcInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_E2E_SVC_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String svc_endpoint = endpoint + "/" + serviceInstanceId;
+
+ return msoClientInterface.deleteE2eSvcInstance(requestDetails, svc_endpoint);
+ }
+
+ @Override
public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
String methodName = "deleteSvcInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
index a84775638..350be4415 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
@@ -20,6 +20,7 @@ public interface MsoInterface {
//For VoLTE E2E services
MsoResponseWrapper createE2eSvcInstance(Object requestDetails, String endpoint) throws Exception;
+ MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint) throws Exception;
/**
* will create a virtual network function using MSO service.
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
index 1b4c52733..7924a7d7d 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
@@ -170,7 +170,7 @@ public class RestMsoImplementation implements RestInterface {
}
@Override
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
+ public <T> void Delete(T t, Object r, String sourceID, String path, RestObject<T> restObject) {
String methodName = "Delete";
String url="";
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index c3deec325..14761cad3 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -85,6 +85,14 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
@Override
+ public MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint) throws Exception {
+ String methodName = "deleteE2eSvcInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ return deleteInstance(requestDetails, endpoint);
+ }
+
+ @Override
public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
String methodName = "deleteSvcInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
@@ -165,7 +173,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
* @return the mso response wrapper
* @throws Exception the exception
*/
- public MsoResponseWrapper deleteInstance(RequestDetails request, String path) throws Exception {
+ public MsoResponseWrapper deleteInstance(Object request, String path) throws Exception {
String methodName = "deleteInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
index 9fc95fcec..38cd51517 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
@@ -37,7 +37,7 @@ public interface RestInterface {
* @param restObject the rest object
* @throws Exception the exception
*/
- <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+ <T> void Delete(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws Exception;
/**
* Post.