Feature-9518: Scale-in/Scale-out commands triggered from the UI
* In NS Instances page. Click "Manual Scaling" in the actions menu.
* Then a new pop-up page will opened.
* In the popup there will be a list box which is filled with the all scaling-group-descriptor names captured from all VNFDs in the NSD and whoose scaling-type is "manual".
* Select scale in / scale out.
* When the scaling-group-descriptor name and the scaling direction are selected then Click Apply button.
* The pop-up window is closed and the page is directed to "History of operations" page for this NS.
Change-Id: Iaaa1500bcabea4ebda89f6c11ea91b28396aa42f
Signed-off-by: Barath Kumar R <barath.r@tataelxsi.co.in>
diff --git a/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts b/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
index a0cac86..7f268d1 100644
--- a/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
+++ b/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
@@ -33,6 +33,7 @@
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
+import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -231,12 +232,16 @@
/** generateData initiate the ns-instance list @private */
private generateData(): void {
this.isLoadingResults = true;
- this.restService.getResource(this.historyURL).subscribe((nsdInstancesData: {}[]) => {
+ this.restService.getResource(this.historyURL).subscribe((nsdInstancesData: {}[]): void => {
this.nsAndnstInstanceData = [];
- nsdInstancesData.forEach((nsdAndnstInstanceData: NSDInstanceData) => {
+ nsdInstancesData.forEach((nsdAndnstInstanceData: NSDInstanceData): void => {
+ let scaleType: string = '';
+ if (!isNullOrUndefined(nsdAndnstInstanceData.operationParams.scaleVnfData)) {
+ scaleType = ' (' + nsdAndnstInstanceData.operationParams.scaleVnfData.scaleVnfType + ')';
+ }
const nsAndnstDataObj: {} = {
id: nsdAndnstInstanceData.id,
- type: nsdAndnstInstanceData.lcmOperationType,
+ type: nsdAndnstInstanceData.lcmOperationType + scaleType,
state: nsdAndnstInstanceData.operationState,
startTime: this.sharedService.convertEpochTime(nsdAndnstInstanceData.startTime),
statusEnteredTime: this.sharedService.convertEpochTime(nsdAndnstInstanceData.statusEnteredTime)
@@ -249,11 +254,11 @@
} else {
this.checkDataClass = 'dataTables_empty';
}
- this.dataSource.load(this.nsAndnstInstanceData).then((data: {}) => {
+ this.dataSource.load(this.nsAndnstInstanceData).then((data: {}): void => {
//empty block
}).catch();
this.isLoadingResults = false;
- }, (error: ERRORDATA) => {
+ }, (error: ERRORDATA): void => {
this.isLoadingResults = false;
if (error.error.status === HttpStatus.NOT_FOUND || error.error.status === HttpStatus.UNAUTHORIZED) {
this.router.navigateByUrl('404', { skipLocationChange: true }).catch();
diff --git a/src/app/instances/ns-instances/NSInstancesComponent.html b/src/app/instances/ns-instances/NSInstancesComponent.html
index 6047a2f..523ee44 100644
--- a/src/app/instances/ns-instances/NSInstancesComponent.html
+++ b/src/app/instances/ns-instances/NSInstancesComponent.html
@@ -31,6 +31,7 @@
<span><i class="fas fa-check-circle text-success"></i>{{operationalStateSecondStep}} /
{{configStateSecondStep}}</span>
<span><i class="fas fa-times-circle text-danger"></i>{{operationalStateThirdStep}}</span>
+ <span><i class="fas fa-compress-alt text-success"></i>{{operationalStateFourthStep}}</span>
</nav>
</div>
<page-per-row class="mr-2" (pagePerRow)="onChange($event)"></page-per-row>
diff --git a/src/app/instances/ns-instances/NSInstancesComponent.ts b/src/app/instances/ns-instances/NSInstancesComponent.ts
index 41bb384..3f20710 100644
--- a/src/app/instances/ns-instances/NSInstancesComponent.ts
+++ b/src/app/instances/ns-instances/NSInstancesComponent.ts
@@ -81,6 +81,9 @@
/** operational State failed data @public */
public operationalStateThirdStep: string = CONFIGCONSTANT.operationalStateThirdStep;
+ /** operational State scaling data @public */
+ public operationalStateFourthStep: string = CONFIGCONSTANT.operationalStateFourthStep;
+
/** Config State init data @public */
public configStateFirstStep: string = CONFIGCONSTANT.configStateFirstStep;
@@ -153,7 +156,8 @@
list: [
{ value: this.operationalStateFirstStep, title: this.operationalStateFirstStep },
{ value: this.operationalStateSecondStep, title: this.operationalStateSecondStep },
- { value: this.operationalStateThirdStep, title: this.operationalStateThirdStep }
+ { value: this.operationalStateThirdStep, title: this.operationalStateThirdStep },
+ { value: this.operationalStateFourthStep, title: this.operationalStateFourthStep }
]
}
},
@@ -170,6 +174,10 @@
return `<span class="icon-label" title="${row.OperationalStatus}">
<i class="fas fa-times-circle text-danger"></i>
</span>`;
+ } else if (row.OperationalStatus === this.operationalStateFourthStep) {
+ return `<span class="icon-label" title="${row.OperationalStatus}">
+ <i class="fas fa-compress-alt text-success"></i>
+ </span>`;
} else {
return `<span>${row.OperationalStatus}</span>`;
}
@@ -230,7 +238,11 @@
ConfigStatus: nsdInstanceData['config-status'],
DetailedStatus: nsdInstanceData['detailed-status'],
memberIndex: nsdInstanceData.nsd.df,
- nsConfig: nsdInstanceData.nsd['ns-configuration']
+ nsConfig: nsdInstanceData.nsd['ns-configuration'],
+ adminDetails: nsdInstanceData._admin,
+ vnfID: nsdInstanceData['vnfd-id'],
+ nsd: nsdInstanceData.nsd,
+ 'nsd-id': nsdInstanceData['nsd-id']
};
this.nsInstanceData.push(nsDataObj);
});