From ba6de666a6bc7860cb272bc9f4357e8c0f188e85 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Sun, 22 Apr 2018 17:51:39 +0300 Subject: Scale out use case Change-Id: If0d42935185d3e4393a2607916c3046b4ebe41c6 Issue-ID: VID-188 Signed-off-by: Sonsino, Ofir (os0695) --- .../changeManagement/ChangeManagementRequest.java | 1 + .../vid/services/ChangeManagementServiceImpl.java | 4 + .../vid/scripts/constants/componentConstants.js | 3 +- .../app/vid/scripts/constants/vidConfiguration.js | 5 +- .../new-change-management.controller.js | 28 +++- .../new-change-management.css | 171 +++++++++++++++++++++ .../new-change-management.html | 57 ++++++- .../webapp/app/vid/styles/modal-create-new.css | 2 +- 8 files changed, 263 insertions(+), 8 deletions(-) create mode 100644 vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css (limited to 'vid-app-common/src/main') diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java index ec375b621..1d866eecd 100644 --- a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java +++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java @@ -27,6 +27,7 @@ public class ChangeManagementRequest { public static final String UPDATE = "update"; public static final String REPLACE = "replace"; public final static String CONFIG_UPDATE = "vnf config update"; + public final static String SCALE_OUT = "vnf scale out"; @JsonProperty("requestDetails") private List requestDetails; diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java index 8f2a87626..ca5fe44da 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java @@ -98,6 +98,10 @@ public class ChangeManagementServiceImpl implements ChangeManagementService { msoResponseWrapperObject = msoBusinessLogic.updateVnfConfig(currentRequestDetails, serviceInstanceId, vnfInstanceId); break; } + case ChangeManagementRequest.SCALE_OUT:{ + msoResponseWrapperObject = msoBusinessLogic.createVfModuleInstance(currentRequestDetails, serviceInstanceId, vnfInstanceId); + break; + } } response = new ResponseEntity(msoResponseWrapperObject.getResponse(), HttpStatus.OK); return response; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js index a59da0580..a9278c36d 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js @@ -220,7 +220,8 @@ appDS2 vnfConfigUpdate: "VNF Config Update", vnfInPlace: "VNF In Place Software Update", update: "update", - replace: "replace" + replace: "replace", + vnfScaleOut: "VNF Scale Out" } }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js index 0b69ed556..716a99c00 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js @@ -107,6 +107,8 @@ appDS2.constant("VIDCONFIGURATION", (function() { var SCHEDULER_PORTAL_URL = ""; + var SCALE_OUT_CONTROLLERS = ["", "SDN-C", "APP-C"]; + return { ASDC_MODEL_STATUS : ASDC_MODEL_STATUS, MSO_MAX_POLLS : MSO_MAX_POLLS, @@ -119,6 +121,7 @@ appDS2.constant("VIDCONFIGURATION", (function() { MACRO_SERVICES : MACRO_SERVICES, COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID, SCHEDULER_CALLBACK_URL: SCHEDULER_CALLBACK_URL, - SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL + SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL, + SCALE_OUT_CONTROLLERS: SCALE_OUT_CONTROLLERS }; })()) diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js index 2444646fe..e337a5271 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js @@ -9,6 +9,16 @@ var vm = this; vm.configUpdatePatternError = "Invalid file type. Please select a file with a CSV extension."; vm.configUpdateContentError = "Invalid file structure."; + vm.controllers = VIDCONFIGURATION.SCALE_OUT_CONTROLLERS; + vm.wizardStep = 1; + vm.nextStep = function(){ + vm.wizardStep++; + $(".modal-dialog").animate({"width":"1000px"},400,'linear'); + }; + vm.prevStep = function(){ + vm.wizardStep--; + $(".modal-dialog").animate({"width":"6000px"},400,'linear'); + }; vm.softwareVersionRegex = "[-a-zA-Z0-9\.]+"; @@ -49,6 +59,7 @@ _.each(response.data.vnfs, function (vnf) { if (newVNFName["invariant-id"] === vnf.invariantUuid) { availableVersions.push(extractVNFModel(vnf, response.data.service, newVNFName)); + newVNFName.vfModules = vnf.vfModules; } }); var versions = _.uniqBy(availableVersions, 'modelInfo.modelVersion'); @@ -132,7 +143,7 @@ }; - /***converting objects to scheduler format (taken from IST)***/ + /***converting objects to scheduler format (taken from IST) - was altered for Scale out support ***/ function extractChangeManagementCallbackDataStr(changeManagement) { console.log(changeManagement); var result = {}; @@ -173,7 +184,13 @@ requestParametersData = { payload: changeManagement.configUpdateFile } - } + }else if(workflowType=="VNF Scale Out"){ + requestParametersData = { + controllerType: changeManagement.controllerType + //userParams: { ..json.. } + //usePreload: false + } + } $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: workflowType '+ workflowType); $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: requestParametersData '+ requestParametersData); @@ -266,7 +283,8 @@ } else { //no scheduling support var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement); - var vnfName = vm.changeManagement.vnfNames[0].name; + //TODO: foreach + var vnfName = vm.changeManagement.vnfNames[0].name; changeManagementService.postChangeManagementNow(dataToSo, vnfName); } }; @@ -525,6 +543,10 @@ vm.isConfigUpdate = function () { return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate; } + + vm.isScaleOut = function () { + return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfScaleOut; + } vm.shouldShowVnfInPlaceFields = function () { return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfInPlace; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css new file mode 100644 index 000000000..4dc2d399a --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css @@ -0,0 +1,171 @@ +.scale-out-modules .table-row { + border: 1px solid #D2D2D2; + display: flex; +} +.scale-out-modules .table-row > div { + text-indent: 12px; + color: #5A5A5A; + font-size: 13px; + border-right: 1px solid #D2D2D2; + line-height: 30px; +} +.scale-out-modules .table-row > div:last-child { + border-right: none; +} +.scale-out-modules .table-row > div:nth-child(1) { + flex: 40px 0 0; +} +.scale-out-modules .table-row > div:nth-child(2) { + flex: 363px 1 0; +} +.scale-out-modules .table-row > div:nth-child(3) { + flex: 90px 0 0; +} +.scale-out-modules .table-row > div:nth-child(4), .scale-out-modules .table-row > div:nth-child(5) { + flex: 150px 0 0; +} +.scale-out-modules .table-row > div:nth-child(6), .scale-out-modules .table-row > div:nth-child(7) { + flex: 120px 0 0; +} +.scale-out-modules .table-header { + border-bottom: none; +} +.scale-out-modules .table-header > div { + background-color: #F2F2F2;"" + color: black; + font-size: 12px; +} +.scale-out-modules .modules-table:not(.open) + .table-row { + border-top: none; +} +.scale-out-modules .modules-table { + display: none; + margin-top: 10px; + margin-bottom: 15px; +} +.scale-out-modules .modules-table .table-row { + margin-left: 60px; +} +.scale-out-modules .modules-table .table-row > div:nth-child(1) { + flex: 539px 0 0; +} +.scale-out-modules .modules-table .table-row > div:nth-child(2) { + flex: 90px 0 0; +} +.scale-out-modules .modules-table .table-row > div:nth-child(3) { + flex: 90px 0 0; +} +.scale-out-modules .modules-table .table-row > div:nth-child(4) { + flex: 180px 0 0; +} +.scale-out-modules .modules-table .table-row > div:nth-child(5) { + flex: 110px 0 0; +} +.scale-out-modules .modules-table.open { + display: block; +} + + +/*LESS*/ +/* + +.scale-out-modules{ + + .table-row{ + border: 1px solid #D2D2D2; + display:flex; + + > div { + text-indent:12px; + color: #5A5A5A; + font-size:13px; + border-right:1px solid #D2D2D2; + line-height:30px; + + &:last-child { + border-right:none; + } + + &:nth-child(1){ + flex:40px 0 0; + } + &:nth-child(2){ + flex:363px 1 0; + } + &:nth-child(3){ + flex:90px 0 0; + } + &:nth-child(4), &:nth-child(5){ + flex:150px 0 0; + } + &:nth-child(6), &:nth-child(7){ + flex:120px 0 0; + } + } + + &.open > div { + line-height:29px; + border-top: 1px #009FDB solid; + border-bottom: 1px #009FDB solid; + &:last-child{ + box-shadow: 0px 0px 0px 0px red, 1px 0px 0px 0px #009FDB; + } + //box-sizing: border-box; + &:nth-child(1){ + border-color: green; + } + &:nth-child(2){ + color:#009FDB; + } + } + } + + .table-header{ + border-bottom:none; + + > div { + background-color:#F2F2F2; + color: black; + font-size:12px; + } + } + + .modules-table:not(.open) + .table-row { + border-top:none; + } + + .modules-table{ + display:none; + margin-top:10px; + margin-bottom:15px; + + .table-row { + margin-left:60px; + & > div{ + + &:nth-child(1){ + flex:539px 0 0; + } + &:nth-child(2){ + flex:90px 0 0; + } + &:nth-child(3){ + flex:90px 0 0; + } + &:nth-child(4){ + flex:180px 0 0; + } + &:nth-child(5){ + flex:110px 0 0; + } + } + } + + &.open{ + display:block; + } + } + +} + +*/ \ No newline at end of file diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html index 4473ee3b8..e14af86d4 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html @@ -4,7 +4,7 @@
- + + + diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css index 1a293c049..7d8af00b9 100644 --- a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css +++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css @@ -1,5 +1,5 @@ .modal-dialog { - width: 587px; + /*width: 587px;*/ border-radius: 8px; } -- cgit 1.2.3-korg