Added DistributeTraffic LCM command support 63/63263/6
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Tue, 28 Aug 2018 13:18:35 +0000 (15:18 +0200)
committerTakamune Cho <tc012c@att.com>
Mon, 17 Sep 2018 20:16:47 +0000 (20:16 +0000)
Proposed change adds support for new LCM API dedicated for
traffic distribution accross different VNFs.

Change-Id: Ib73a9dea6810163f504f5126b35640971eb7f87a
Issue-ID: APPC-1170
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
src/app/test/test.component.spec.ts
src/app/test/test.component.ts
src/app/vnfs/build-artifacts/build-artifacts.component.ts
src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts
src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html
src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.ts
src/constants/app-constants.ts

index 42e8be7..cb69445 100644 (file)
@@ -426,6 +426,7 @@ describe( 'TestComponent', () => {
             expect(component.getUrlEndPoint('healthcheck')).toEqual('health-check');
             expect(component.getUrlEndPoint('quiescetraffic')).toEqual('quiesce-traffic');
             expect(component.getUrlEndPoint('resumetraffic')).toEqual('resume-traffic');
+            expect(component.getUrlEndPoint('distributetraffic')).toEqual('distribute-traffic');
             expect(component.getUrlEndPoint('startapplication')).toEqual('start-application');
             expect(component.getUrlEndPoint('stopapplication')).toEqual('stop-application');
             expect(component.getUrlEndPoint('upgradebackout')).toEqual('upgrade-backout');
index 529e628..f3f6a94 100644 (file)
@@ -482,6 +482,8 @@ export class TestComponent implements OnInit {
                 return 'quiesce-traffic';
             case 'resumetraffic':
                 return 'resume-traffic';
+            case 'distributetraffic':
+                return 'distribute-traffic';
             case 'startapplication':
                 return 'start-application';
             case 'stopapplication':
index 095c239..d95b478 100644 (file)
@@ -28,7 +28,7 @@ import * as _ from 'underscore';
 import { NotificationsService } from 'angular2-notifications';
 import { appConstants } from '../../../constants/app-constants';
 
-export const ACTIONS_REQUIRED_DROPDOWN = ['Configure', 'ConfigModify', 'ConfigScaleOut'];
+export const ACTIONS_REQUIRED_DROPDOWN = ['Configure', 'ConfigModify', 'ConfigScaleOut', 'DistributeTraffic'];
 
 @Component({ selector: 'app-build-design', templateUrl: './build-artifacts.component.html', styleUrls: ['./build-artifacts.component.css'] })
 export class BuildDesignComponent implements OnInit {
index 28c2a19..f7d1837 100644 (file)
@@ -84,7 +84,8 @@ export class ParameterComponent implements OnInit {
         { action: appConstants.Actions.getRunningConfig, value: appConstants.Actions.getRunningConfig },
         { action: appConstants.Actions.healthCheck, value: appConstants.Actions.healthCheck },
         { action: appConstants.Actions.startApplication, value: appConstants.Actions.startApplication },
-        { action: appConstants.Actions.stopApplication, value: appConstants.Actions.stopApplication }
+        { action: appConstants.Actions.stopApplication, value: appConstants.Actions.stopApplication },
+        { action: appConstants.Actions.distributeTraffic, value: appConstants.Actions.distributeTraffic }
     ];
     public uploadTypes = appConstants.uploadTypes;
 
index e9a8c64..564cd32 100644 (file)
@@ -44,7 +44,7 @@ limitations under the License.
                     <span class="error-message" [hidden]="vnfParams?.vnfType || vnftype.valid || (vnftype.pristine && !userForm.submitted)">Required Field</span>
                 </div>
 
-                <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="((displayVnfc=='true') || isVnfcType) && (referenceDataObject['action']=='Configure' || referenceDataObject['action']=='ConfigModify')">
+                <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="((displayVnfc=='true') || isVnfcType) && (referenceDataObject['action']=='Configure' || referenceDataObject['action']=='ConfigModify' || referenceDataObject['action']=='DistributeTraffic')">
                     <label>VNFC Type</label>
                     <input *ngIf="isVnfcType" type="text" class="form-control" readonly id="txtVnfcType" [(ngModel)]="referenceDataObject.scope['vnfc-type']" (blur)="setVnfcType($event.target.value)" (ngModelChange)="updateSessionValues($event,'vnfcType')" #vnfcType="ngModel"
                         name="vnfcType">
@@ -55,7 +55,7 @@ limitations under the License.
                     <a *ngIf="isVnfcTypeList" style="    color: blue;" href="javascript:void(0)" (click)="vnfcModal.open()">Add New VNFC Type</a>
                 </div>
 
-                <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="displayVnfc!='true' || (referenceDataObject['action']!='Configure' && referenceDataObject['action']!='ConfigModify')">
+                <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12" *ngIf="displayVnfc!='true' || (referenceDataObject['action']!='Configure' && referenceDataObject['action']!='ConfigModify' && referenceDataObject['action']!='DistributeTraffic')">
                 </div>
                 <div class="col-lg-3 col-sm-6 col-md-3 col-xs-12">
                     <label>Device Protocol*</label>
index 79be2c5..83d61fe 100644 (file)
@@ -137,6 +137,7 @@ export class ReferenceDataformComponent implements OnInit {
                         appConstants.Actions.stopApplication,
                         appConstants.Actions.quiesceTraffic,
                         appConstants.Actions.resumeTraffic,
+                        appConstants.Actions.distributeTraffic,
                         appConstants.Actions.upgradeBackout,
                         appConstants.Actions.upgradeBackup,
                         appConstants.Actions.upgradePostCheck,
@@ -185,7 +186,7 @@ export class ReferenceDataformComponent implements OnInit {
     public firstArrayElement = [];
     public remUploadedDataArray = [];
     isConfigScaleOut = false
-    isConfigOrConfigModify = false;
+    isConfigureAction = false;
     configScaleOutExist: boolean = true;
     displayVnfc = 'false';
     isVnfcType: boolean;
@@ -222,9 +223,9 @@ export class ReferenceDataformComponent implements OnInit {
         console.log( this.classNm+": "+methName+": start.");
         this.displayVnfc = sessionStorage.getItem("vnfcSelectionFlag");
         if (this.configScaleOutExist) {
-            this.actions = ['', 'Configure', 'ConfigModify', 'ConfigBackup', 'ConfigRestore', 'GetRunningConfig', 'HealthCheck', 'StartApplication', 'StopApplication', 'QuiesceTraffic', 'ResumeTraffic', 'UpgradeBackout', 'UpgradeBackup', 'UpgradePostCheck', 'UpgradePreCheck', 'UpgradeSoftware', 'OpenStack Actions', 'ConfigScaleOut'];
+            this.actions = ['', 'Configure', 'ConfigModify', 'ConfigBackup', 'ConfigRestore', 'GetRunningConfig', 'HealthCheck', 'StartApplication', 'StopApplication', 'QuiesceTraffic', 'ResumeTraffic', 'DistributeTraffic', 'UpgradeBackout', 'UpgradeBackup', 'UpgradePostCheck', 'UpgradePreCheck', 'UpgradeSoftware', 'OpenStack Actions', 'ConfigScaleOut'];
         } else {
-            this.actions = ['', 'Configure', 'ConfigModify', 'ConfigBackup', 'ConfigRestore', 'GetRunningConfig', 'HealthCheck', 'StartApplication', 'StopApplication', 'QuiesceTraffic', 'ResumeTraffic', 'UpgradeBackout', 'UpgradeBackup', 'UpgradePostCheck', 'UpgradePreCheck', 'UpgradeSoftware', 'OpenStack Actions'];
+            this.actions = ['', 'Configure', 'ConfigModify', 'ConfigBackup', 'ConfigRestore', 'GetRunningConfig', 'HealthCheck', 'StartApplication', 'StopApplication', 'QuiesceTraffic', 'ResumeTraffic', 'DistributeTraffic', 'UpgradeBackout', 'UpgradeBackup', 'UpgradePostCheck', 'UpgradePreCheck', 'UpgradeSoftware', 'OpenStack Actions'];
         }
         this.self = this;
         let path = this.location.path;
@@ -1094,6 +1095,7 @@ export class ReferenceDataformComponent implements OnInit {
             case 'UpgradeBackout':
             case 'ResumeTraffic':
             case 'QuiesceTraffic':
+            case 'DistributeTraffic':
             case 'UpgradeBackup':
             case 'UpgradePostCheck':
             case 'UpgradePreCheck':
@@ -1182,10 +1184,10 @@ export class ReferenceDataformComponent implements OnInit {
                         this.refernceScopeObj.from = '';
                     }
 
-                    if (this.referenceDataObject.action === 'Configure' || this.referenceDataObject.action === 'ConfigModify') {
-                        this.isConfigOrConfigModify = true;
+                    if (this.referenceDataObject.action === 'Configure' || this.referenceDataObject.action === 'ConfigModify' || this.referenceDataObject.action === 'DistributeTraffic') {
+                        this.isConfigureAction = true;
                     } else {
-                        this.isConfigOrConfigModify = false;
+                        this.isConfigureAction = false;
                         delete this.mappingEditorService.newObject['vnfc'];
                     }
 
@@ -1255,7 +1257,7 @@ export class ReferenceDataformComponent implements OnInit {
                 }*/
             ];
         }
-        if (data == 'Configure' || data == 'ConfigModify') {
+        if (data == 'Configure' || data == 'ConfigModify' || data == 'DistributeTraffic') {
             this.nonConfigureAction = false;
         } else {
             this.nonConfigureAction = true;
@@ -1506,7 +1508,7 @@ export class ReferenceDataformComponent implements OnInit {
             this.referenceDataObject.scope['vnfc-type-list'].push(newVnfcTypeV);
         }
         this.tempAllData.forEach(obj => {
-            if (obj.action == "Configure" || obj.action == "ConfigModify") {
+            if (obj.action == "Configure" || obj.action == "ConfigModify" || obj.action == "DistributeTraffic") {
                 obj.scope['vnfc-type-list'] = this.referenceDataObject.scope['vnfc-type-list']
             }
             this.resetArtifactList(obj);
@@ -1567,7 +1569,7 @@ export class ReferenceDataformComponent implements OnInit {
         //if VNFC is entered set action level & Scope type to VNFC for configure and configure modify, and default the values to vnf and vnf type for all other actions  
         else {
             scopeName = this.referenceDataObject.scope['vnfc-type'];
-            if (this.referenceDataObject.action == 'Configure' || this.referenceDataObject.action == 'ConfigModify') {
+            if (this.referenceDataObject.action == 'Configure' || this.referenceDataObject.action == 'ConfigModify' || this.referenceDataObject.action == 'DistributeTraffic') {
                 this.referenceDataObject['action-level'] = 'vnfc';
                 this.referenceDataObject['scopeType'] = 'vnfc-type';
             } else {
@@ -1722,7 +1724,7 @@ export class ReferenceDataformComponent implements OnInit {
         if (newObj.action != 'HealthCheck') {
             delete newObj['url'];
         }
-        if (newObj.action != "Configure" && newObj.action != "ConfigModify") {
+        if (newObj.action != "Configure" && newObj.action != "ConfigModify" && newObj.action != "DistributeTraffic") {
             newObj.scope['vnfc-type-list'] = [];
         }
         return newObj
index 0be5f68..8afa5bc 100644 (file)
@@ -92,7 +92,8 @@ export class GoldenConfigurationComponent implements OnInit {
     { action: "GetRunningConfig", value: "GetRunningConfig" },
     { action: "HealthCheck", value: "HealthCheck" },
     { action: "StartApplication", value: "StartApplication" },
-    { action: "StopApplication", value: "StopApplication" }
+    { action: "StopApplication", value: "StopApplication" },
+    { action: "DistributeTraffic", value: "DistributeTraffic" }
   ];
   options = {
     timeOut: 1000,
index 290d299..bd06feb 100644 (file)
@@ -63,6 +63,7 @@ export const appConstants = {
         "stopApplication": "StopApplication",
         "quiesceTraffic": "QuiesceTraffic",
         "resumeTraffic": "ResumeTraffic",
+        "distributeTraffic": "DistributeTraffic",
         "upgradeBackout": "UpgradeBackout",
         "upgradeBackup": "UpgradeBackup",
         "upgradePostCheck": "UpgradePostCheck",