summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-06-05 19:29:39 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-06-05 19:29:39 +0300
commit195a4993601a572df71b7905b6720eeda1a6ec28 (patch)
tree4f9acdbe63e1f25f848ee09621e96f3c168da21b
parentbef8d8ad7597f3fec56d49152d15a3bc072feb37 (diff)
Change-Id: I506a30d012003d8f6efb7c894435c28f1e421ac4 Issue-ID: VID-189 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
-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
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js10
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js21
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm8
10 files changed, 88 insertions, 11 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.
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
index 9715484d4..cdda3a143 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
@@ -21,7 +21,7 @@
"use strict";
var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
- DeleteResumeService, CreationService, UtilityService) {
+ DeleteResumeService, CreationService, DataService, UtilityService) {
$scope.isDialogVisible = false;
$scope.summaryControl = {};
@@ -32,6 +32,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t
$scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) {
+ $scope.isE2EService = false;
$scope.isDataVisible = false;
$scope.isSpinnerVisible = false;
$scope.isErrorVisible = false;
@@ -41,6 +42,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t
$scope.dialogMethod = request.dialogMethod;
callbackFunction = request.callbackFunction;
componentId = request.componentId;
+ $scope.isServiceInstance = componentId === "service";
DeleteResumeService.initializeComponent(request.componentId);
@@ -69,6 +71,8 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t
}
$scope.confirm = function() {
+ DataService.setE2EService($scope.isE2EService); //VoLTE support
+
var requiredFields = $scope.userProvidedControl.getRequiredFields();
if (requiredFields === "") {
$scope.isErrorVisible = false;
@@ -96,7 +100,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t
var requestDetails = DeleteResumeService.getMsoRequestDetails($scope.userProvidedControl.getList());
- if(DeleteResumeService.isMacro === true){
+ if(!DataService.getE2EService() && DeleteResumeService.isMacro === true){
requestDetails.requestParameters.aLaCarte = false;
}
@@ -144,5 +148,5 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t
}
appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
- "$timeout", "$log", "DeleteResumeService","CreationService", "UtilityService",
+ "$timeout", "$log", "DeleteResumeService","CreationService", "DataService", "UtilityService",
deleteResumeDialogController]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index 90daf3550..3255bc9a3 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -266,8 +266,10 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
+ DataService.getServiceInstanceId() + "/networks/"
+ DataService.getNetworkInstanceId();
case COMPONENT.SERVICE:
- return "mso_delete_svc_instance/"
- + DataService.getServiceInstanceId();
+ if(DataService.getE2EService() === true)
+ return "mso_delete_e2e_svc_instance/"+ DataService.getServiceInstanceId();
+ else
+ return "mso_delete_svc_instance/"+ DataService.getServiceInstanceId();
case COMPONENT.VNF:
return "mso_delete_vnf_instance/"
+ DataService.getServiceInstanceId() + "/vnfs/"
@@ -291,9 +293,22 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
value : value
});
};
-
+
+ var getMsoE2ERequest = function(parameterList) {
+ return {
+ "globalSubscriberId": DataService.getSubscriberName(),
+ "serviceType": DataService.getServiceType()
+ };
+ };
+
var getMsoRequestDetails = function(parameterList) {
console.log("getMsoRequestDetails invoked");
+
+ //VoLTE logic goes here
+ if(DataService.getE2EService() === true) {
+ return getMsoE2ERequest(parameterList);
+ }
+
var inventoryInfo = ComponentService.getInventoryInfo(
_this.componentId, DataService.getInventoryItem());
var modelInfo = DataService.getModelInfo(_this.componentId);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
index ccd54a612..efaca5bd3 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
@@ -32,7 +32,13 @@
</div>
<parameter-block control="summaryControl"></parameter-block>
-
+
+ <!-- tell VID if it's an E2E VoLTE service-->
+ <div style="margin-left: 15px" ng-show="isServiceInstance">
+ <input type="checkbox" ng-model="isE2EService" />
+ This is an E2E (VoLTE) service instance
+ </div>
+
<div ngx-visible="{{isDataVisible}}">
<h4>