Scale out use case 67/44067/1
authorSonsino, Ofir (os0695) <os0695@intl.att.com>
Sun, 22 Apr 2018 14:51:39 +0000 (17:51 +0300)
committerSonsino, Ofir (os0695) <os0695@intl.att.com>
Sun, 22 Apr 2018 14:51:39 +0000 (17:51 +0300)
Change-Id: If0d42935185d3e4393a2607916c3046b4ebe41c6
Issue-ID: VID-188
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
.gitignore
epsdk-app-onap/src/main/resources/vid-data.sql
vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java
vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css [new file with mode: 0644]
vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css

index 774e74c..4b81f12 100644 (file)
@@ -27,3 +27,9 @@ deliveries/target/
 /epsdk-app-onap/logs/EELF/policy.log
 /epsdk-app-onap/logs/EELF/security.log
 /epsdk-app-onap/logs/EELF/server.log
+/vid-app-common/.idea/encodings.xml
+/vid-app-common/.idea/misc.xml
+/vid-app-common/.idea/modules.xml
+/vid-app-common/.idea/vid-app-common.iml
+/vid-app-common/.idea/workspace.xml
+/vid-app-common/.settings/org.eclipse.core.resources.prefs
index b570c66..6d4d670 100755 (executable)
@@ -50,9 +50,11 @@ INSERT IGNORE INTO `fn_app` VALUES (1,'Default',null,'Some Default Description',
 --\r
 -- Dumping data for table `vid_workflow`\r
 --\r
-INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (1, 'Update') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='Update';\r
-INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (2, 'Replace') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='Replace';\r
+--update & replace workflows are disabled in ONAP\r
+--INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (1, 'Update') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='Update';\r
+--INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (2, 'Replace') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='Replace';\r
 INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (3, 'VNF In Place Software Update') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='VNF In Place Software Update';\r
+INSERT INTO `vid_workflow` (`WORKFLOW_DB_ID`, `WORKFLOW_APP_NAME`) VALUES (4, 'VNF Scale Out') ON DUPLICATE KEY UPDATE WORKFLOW_APP_NAME='VNF Scale Out';\r
 \r
 \r
 --\r
index ec375b6..1d866ee 100644 (file)
@@ -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> requestDetails;
index 8f2a876..ca5fe44 100644 (file)
@@ -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<String>(msoResponseWrapperObject.getResponse(), HttpStatus.OK);
                 return response;
index a59da05..a9278c3 100755 (executable)
@@ -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"
        }
 
     };
index 0b69ed5..716a99c 100755 (executable)
@@ -107,6 +107,8 @@ appDS2.constant("VIDCONFIGURATION", (function() {
 \r
        var SCHEDULER_PORTAL_URL = "";\r
 \r
+       var SCALE_OUT_CONTROLLERS = ["", "SDN-C", "APP-C"];\r
+       \r
     return {\r
        ASDC_MODEL_STATUS : ASDC_MODEL_STATUS,\r
        MSO_MAX_POLLS : MSO_MAX_POLLS,\r
@@ -119,6 +121,7 @@ appDS2.constant("VIDCONFIGURATION", (function() {
        MACRO_SERVICES : MACRO_SERVICES,\r
        COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID,\r
         SCHEDULER_CALLBACK_URL: SCHEDULER_CALLBACK_URL,\r
-        SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL\r
+        SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL,\r
+               SCALE_OUT_CONTROLLERS: SCALE_OUT_CONTROLLERS\r
     };\r
 })())\r
index 2444646..e337a52 100644 (file)
@@ -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');
         };
 
 
-               /***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 = {};
                                                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);
 
                        } 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);
                        }
         };
         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 (file)
index 0000000..4dc2d39
--- /dev/null
@@ -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
index 4473ee3..e14af86 100644 (file)
@@ -4,7 +4,7 @@
     <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
 </div>
 <form class="form-create" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate>
-    <div class="modal-body">
+    <div class="modal-body step1" ng-show="vm.wizardStep === 1" >
         <div class="form-group">
             <label class="control-label">Subscriber</label>
             <select class="form-control" ng-model="vm.changeManagement.subscriberId" ng-change="vm.loadServiceTypes()" name="subscriber" id="subscriber" data-tests-id="subscriberName" required>
             </div>
 
         </div>
+        <div ng-if="vm.isScaleOut()">
+            <div class="form-group">
+                <label class="control-label">Controller Type</label>
+                <select class="form-control" ng-model="vm.changeManagement.controllerType" name="controllerType" id="controllerType"
+                        ng-options="o as o for o in vm.controllers">
+                </select>
+            </div>
+        </div>
     </div>
+
+    <div class="modal-body step2 scale-out-modules" ng-if="vm.wizardStep === 2">
+
+        <div class="table-header table-row">
+            <div></div>
+            <div>VNF instance name</div>
+            <div>Model V</div>
+            <div>Category</div>
+            <div>Sub Category</div>
+            <div>UUID</div>
+            <div>Invariant UUID</div>
+        </div>
+
+        <div class="table-row" ng-repeat-start="vnf in vm.changeManagement.vnfNames" ng-if="vnf['prov-status'] === 'PROV'">
+            <div></div>
+            <div>{{vnf.name}} service instance name: {{vnf['service-instance-node'].properties['service-instance-name']}}</div>
+            <div>2</div>
+            <div>Category</div>
+            <div>Sub Category</div>
+            <div>{{vnf.modelVersionId}}</div>
+            <div>{{vnf['invariant-id']}}</div>
+        </div>
+        <div class="modules-table open" ng-repeat-end="">
+            <div class="table-header table-row">
+                <div>VF Module</div>
+                <div>In Service</div>
+                <div>Scale</div>
+                <div>Module UID</div>
+                <div>File</div>
+            </div>
+
+            <div class="table-row" ng-repeat="(key, module) in vnf.vfModules">
+                <div>{{module.modelCustomizationName}}</div>
+                <div>{{module.properties.minCountInstances}} - {{module.properties.maxCountInstances}}</div>
+                <div>Category</div>
+                <div>{{module.uuid}}</div>
+                <div>
+                    <input type="file" ng-model="module.file" accept="application/json" />
+                </div>
+            </div>
+        </div>
+
+    </div>
+
     <div class="modal-footer">
         <div class="pull-right">
-            <button type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Schedule</button>
+            <button ng-if="!vm.isScaleOut() || (vm.isScaleOut() && vm.wizardStep === 2)" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Schedule</button>
+            <button ng-if="vm.isScaleOut() && vm.wizardStep === 1" ng-click="vm.nextStep();" type="button" id="next" name="next" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Next</button>
             <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
         </div>
     </div>