From 99144589707c8c854149258c87cd3871b4c4f6be Mon Sep 17 00:00:00 2001 From: "SANDHYA.JS" Date: Wed, 27 Apr 2022 17:22:35 +0530 Subject: [PATCH] Feature 10912, 10916: NS Update *Added NG-UI support to remove VNF and change VNF in NS update *In NS Instances page. Click "Ns Update" in the actions menu. *Then a new pop-up page will opened. *In the popup there will be drop-down containing Update Type with 'CHANGE_VNFPKG' & 'REMOVE_VNFPKG', membervnfIndex and text field Vnfd Id. *When the fields are selected then Click Apply button. *For CHANGE_VNFPKG type, the software-version will be checked whether matching or not and corresponding popup will be shown. *The pop-up window is closed and the page is directed to "History of operations" page Change-Id: I135dda039a381b1faa62baa263543e1f210384f7 Signed-off-by: SANDHYA.JS --- src/app/AppModule.ts | 10 +- .../NSInstancesActionComponent.html | 4 + .../NSInstancesActionComponent.ts | 14 + .../ns-update/NsUpdateComponent.html | 68 ++++ .../ns-update/NsUpdateComponent.scss | 17 + .../utilities/ns-update/NsUpdateComponent.ts | 342 ++++++++++++++++++ .../utilities/warning/WarningComponent.html | 33 ++ .../utilities/warning/WarningComponent.scss | 17 + src/app/utilities/warning/WarningComponent.ts | 74 ++++ src/assets/i18n/de.json | 9 + src/assets/i18n/en.json | 11 + src/assets/i18n/es.json | 11 + src/assets/i18n/pt.json | 11 + src/models/CommonModel.ts | 4 +- src/models/NSInstanceModel.ts | 22 ++ src/models/VNFDModel.ts | 1 + tsconfig.json | 4 +- 17 files changed, 648 insertions(+), 4 deletions(-) create mode 100644 src/app/utilities/ns-update/NsUpdateComponent.html create mode 100644 src/app/utilities/ns-update/NsUpdateComponent.scss create mode 100644 src/app/utilities/ns-update/NsUpdateComponent.ts create mode 100644 src/app/utilities/warning/WarningComponent.html create mode 100644 src/app/utilities/warning/WarningComponent.scss create mode 100644 src/app/utilities/warning/WarningComponent.ts diff --git a/src/app/AppModule.ts b/src/app/AppModule.ts index 06d1004..cc9af15 100644 --- a/src/app/AppModule.ts +++ b/src/app/AppModule.ts @@ -65,6 +65,7 @@ import { NetsliceInstancesActionComponent } from 'NetsliceInstancesActionCompone import { NetslicePackagesActionComponent } from 'NetslicePackagesAction'; import { NSInstancesActionComponent } from 'NSInstancesActionComponent'; import { NsPackagesActionComponent } from 'NsPackagesAction'; +import { NsUpdateComponent } from 'NsUpdateComponent'; import { PageNotFoundComponent } from 'PageNotFound'; import { PDUInstancesActionComponent } from 'PDUInstancesActionComponent'; import { ProjectLinkComponent } from 'ProjectLinkComponent'; @@ -81,6 +82,7 @@ import { VmMigrationComponent } from 'VmMigrationComponent'; import { VNFInstancesActionComponent } from 'VNFInstancesActionComponent'; import { VNFLinkComponent } from 'VNFLinkComponent'; import { VNFPackagesActionComponent } from 'VNFPackagesAction'; +import { WarningComponent } from 'WarningComponent'; import { WIMAccountsActionComponent } from 'WIMAccountsAction'; /** @@ -129,7 +131,9 @@ const customNotifierOptions: NotifierOptions = { GoToTopDirective, ScalingComponent, ChangePasswordComponent, - VmMigrationComponent + VmMigrationComponent, + NsUpdateComponent, + WarningComponent ], imports: [ NotifierModule.withConfig(customNotifierOptions), @@ -204,7 +208,9 @@ const customNotifierOptions: NotifierOptions = { SwitchProjectComponent, ScalingComponent, ChangePasswordComponent, - VmMigrationComponent + VmMigrationComponent, + NsUpdateComponent, + WarningComponent ] }) diff --git a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html index df5bbd7..92e462f 100644 --- a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html +++ b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html @@ -47,6 +47,10 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i [disabled]="operationalStatus === 'failed' || configStatus === 'failed'" ngbTooltip="{{'VMMIGRATION' | translate}}"> {{'VMMIGRATION' | translate}} + diff --git a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts index fb52423..3735df7 100644 --- a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts +++ b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts @@ -29,6 +29,7 @@ import { environment } from 'environment'; import { NSDDetails } from 'NSDModel'; import { NSDInstanceData } from 'NSInstanceModel'; import { NSPrimitiveComponent } from 'NSPrimitiveComponent'; +import { NsUpdateComponent } from 'NsUpdateComponent'; import { RestService } from 'RestService'; import { forkJoin, Observable } from 'rxjs'; import { ScalingComponent } from 'ScalingComponent'; @@ -270,6 +271,19 @@ export class NSInstancesActionComponent { }).catch(); } + /** To open the Ns Update pop-up */ + public openNsUpdate(): void { + const modalRef: NgbModalRef = this.modalService.open(NsUpdateComponent, { backdrop: 'static' }); + modalRef.componentInstance.params = { + id: this.instanceID + }; + modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => { + if (result) { + this.sharedService.callData(); + } + }).catch(); + } + /** * Check any changes in the child component @public */ diff --git a/src/app/utilities/ns-update/NsUpdateComponent.html b/src/app/utilities/ns-update/NsUpdateComponent.html new file mode 100644 index 0000000..e3058d6 --- /dev/null +++ b/src/app/utilities/ns-update/NsUpdateComponent.html @@ -0,0 +1,68 @@ + + +
+ + +
+ \ No newline at end of file diff --git a/src/app/utilities/ns-update/NsUpdateComponent.scss b/src/app/utilities/ns-update/NsUpdateComponent.scss new file mode 100644 index 0000000..c55461a --- /dev/null +++ b/src/app/utilities/ns-update/NsUpdateComponent.scss @@ -0,0 +1,17 @@ +/* + Copyright 2020 TATA ELXSI + + Licensed under the Apache License, Version 2.0 (the 'License'); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) +*/ \ No newline at end of file diff --git a/src/app/utilities/ns-update/NsUpdateComponent.ts b/src/app/utilities/ns-update/NsUpdateComponent.ts new file mode 100644 index 0000000..80ddbb4 --- /dev/null +++ b/src/app/utilities/ns-update/NsUpdateComponent.ts @@ -0,0 +1,342 @@ +/* + Copyright 2020 TATA ELXSI + + Licensed under the Apache License, Version 2.0 (the 'License'); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) +*/ +/** + * @file Ns Update Component + */ +import { HttpHeaders } from '@angular/common/http'; +import { Component, Injector, Input, OnInit } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Router } from '@angular/router'; +import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService } from '@ngx-translate/core'; +import { APIURLHEADER, CONFIGCONSTANT, ERRORDATA, MODALCLOSERESPONSEDATA, URLPARAMS } from 'CommonModel'; +import { environment } from 'environment'; +import { NSUPDATE, TERMINATEVNF } from 'NSInstanceModel'; +import { RestService } from 'RestService'; +import { SharedService } from 'SharedService'; +import { isNullOrUndefined } from 'util'; +import { VNFD } from 'VNFDModel'; +import { VNFInstanceDetails } from 'VNFInstanceModel'; +import { WarningComponent } from 'WarningComponent'; + +/** + * Creating component + * @Component takes NsUpdateComponent.html as template url + */ +@Component({ + selector: 'app-ns-update', + templateUrl: './NsUpdateComponent.html', + styleUrls: ['./NsUpdateComponent.scss'] +}) +export class NsUpdateComponent implements OnInit { + /** To inject services @public */ + public injector: Injector; + /** Instance for active modal service @public */ + public activeModal: NgbActiveModal; + /** Check the loading results @public */ + public isLoadingResults: Boolean = false; + /** Give the message for the loading @public */ + public message: string = 'PLEASEWAIT'; + /** FormGroup instance added to the form @ html @public */ + public nsUpdateForm: FormGroup; + /** Items for the member types @public */ + public memberTypes: {}[]; + /** Contains objects that is used to hold types of primitive @public */ + public updateTypeList: {}[] = []; + /** Form valid on submit trigger @public */ + public submitted: boolean = false; + /** Give the update type @public */ + public terminateVnf: string; + /** Model value used to hold selected MemberVNFIndex @public */ + public memberIndexValue: string; + /** Form Check vnfdId Section @public */ + public vnfdIdShow: boolean = false; + /** Contains MemberVNFIndex values @public */ + public memberVnfIndex: {}[] = []; + /** Array holds VNFR Data filtered with nsr ID @public */ + public nsIdFilteredData: {}[] = []; + /** Contains vnfdId value @public */ + public vnfdId: string; + /** Contains vnfId value of the selected MemberVnfIndex @public */ + public vnfID: string; + /** Contains version of the selected MemberVnfIndex @public */ + public version: string; + /** Contains version of the vnfId @public */ + public vnfversion: string; + /** Contains vnfInstanceId of the selected MemberVnfIndex @public */ + public instanceId: string; + /** Selected VNFInstanceId @public */ + public selectedvnfId: string = ''; + /** Input contains component objects @private */ + @Input() private params: URLPARAMS; + /** FormBuilder instance added to the formBuilder @private */ + private formBuilder: FormBuilder; + /** Contains tranlsate instance @private */ + private translateService: TranslateService; + /** Instance of the rest service @private */ + private restService: RestService; + /** Controls the header form @private */ + private headers: HttpHeaders; + /** Contains all methods related to shared @private */ + private sharedService: SharedService; + /** Holds the instance of AuthService class of type AuthService @private */ + private router: Router; + /** Instance of the modal service @private */ + private modalService: NgbModal; + constructor(injector: Injector) { + this.injector = injector; + this.restService = this.injector.get(RestService); + this.activeModal = this.injector.get(NgbActiveModal); + this.formBuilder = this.injector.get(FormBuilder); + this.sharedService = this.injector.get(SharedService); + this.translateService = this.injector.get(TranslateService); + this.router = this.injector.get(Router); + this.modalService = this.injector.get(NgbModal); + this.updateTypeList = [ + { + title: this.translateService.instant('VNFPKGCHANGE'), + value: 'CHANGE_VNFPKG' + }, + { + title: this.translateService.instant('REMOVEVNF'), + value: 'REMOVE_VNF' + } + ]; + } + /** convenience getter for easy access to form fields */ + get f(): FormGroup['controls'] { return this.nsUpdateForm.controls; } + /** + * Lifecyle Hooks the trigger before component is instantiate + */ + public ngOnInit(): void { + this.initializeForm(); + this.getMemberVnfIndex(); + this.headers = new HttpHeaders({ + 'Content-Type': 'application/json', + Accept: 'application/json', + 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0' + }); + } + + /** Initialize Ns Update Forms @public */ + public initializeForm(): void { + this.nsUpdateForm = this.formBuilder.group({ + updateType: [null, [Validators.required]], + memberVnfIndex: [null, [Validators.required]], + vnfdId: [null, [Validators.required]] + }); + } + + /** Getting MemberVnfIndex using NSDescriptor API @public */ + public getMemberVnfIndex(): void { + const vnfInstanceData: {}[] = []; + this.restService.getResource(environment.VNFINSTANCES_URL).subscribe((vnfInstancesData: VNFInstanceDetails[]): void => { + vnfInstancesData.forEach((vnfData: VNFInstanceDetails): void => { + const vnfDataObj: {} = + { + VNFD: vnfData['vnfd-ref'], + VNFInstanceId: vnfData._id, + MemberIndex: vnfData['member-vnf-index-ref'], + NS: vnfData['nsr-id-ref'], + VNFID: vnfData['vnfd-id'] + }; + vnfInstanceData.push(vnfDataObj); + }); + const nsId: string = 'NS'; + this.nsIdFilteredData = vnfInstanceData.filter((vnfdData: {}[]): boolean => vnfdData[nsId] === this.params.id); + this.nsIdFilteredData.forEach((resVNF: {}[]): void => { + const memberIndex: string = 'MemberIndex'; + const vnfinstanceID: string = 'VNFInstanceId'; + const assignMemberIndex: {} = { + id: resVNF[memberIndex], + vnfinstanceId: resVNF[vnfinstanceID] + }; + this.memberVnfIndex.push(assignMemberIndex); + }); + this.memberTypes = this.memberVnfIndex; + this.isLoadingResults = false; + }, (error: ERRORDATA): void => { + this.restService.handleError(error, 'get'); + this.isLoadingResults = false; + }); + } + + /** + * Fetching the VNFR Information filtered with MemberVnfIndex + * Get the selected VNF Instance ID + */ + public getSelectedVNF(id: string): void { + this.instanceId = id; + let memberIndexFilteredData: {}[] = []; + const memberIndex: string = 'MemberIndex'; + memberIndexFilteredData = this.nsIdFilteredData.filter((vnfdData: {}[]): boolean => + vnfdData[memberIndex] === this.memberIndexValue); + const vnfId: string = 'VNFID'; + const selectedvnfId: string = 'VNFD'; + for (const data of memberIndexFilteredData) { + this.vnfID = data[vnfId]; + this.selectedvnfId = data[selectedvnfId]; + } + } + + /** Trigger NsUpdate on submit */ + public triggerNsUpdate(): void { + this.submitted = true; + this.sharedService.cleanForm(this.nsUpdateForm); + if (this.nsUpdateForm.invalid) { return; } // Proceed, onces form is valid + this.vnfdId = this.nsUpdateForm.value.vnfdId; + this.checkUpdateType(); + } + + /** Ns Update on submit */ + public onSubmit(): void { + if (this.terminateVnf === 'REMOVE_VNF') { + const nsUpdateTerminatePayload: TERMINATEVNF = { + lcmOperationType: 'update', + updateType: this.nsUpdateForm.value.updateType, + nsInstanceId: this.params.id, + removeVnfInstanceId: this.instanceId + }; + this.nsUpdateInitialization(nsUpdateTerminatePayload); + } else { + const nsUpdatePayload: NSUPDATE = { + lcmOperationType: 'update', + updateType: this.nsUpdateForm.value.updateType, + nsInstanceId: this.params.id, + changeVnfPackageData: { + vnfInstanceId: this.instanceId, + vnfdId: this.nsUpdateForm.value.vnfdId + } + }; + this.nsUpdateInitialization(nsUpdatePayload); + } + } + + /** + * Open Modal based on selected NS-UPDATE Type + */ + public checkUpdateType(): void { + this.isLoadingResults = true; + if (this.nsUpdateForm.value.updateType === 'CHANGE_VNFPKG') { + this.checkVersion(); + } else { + const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' }); + modalRef.componentInstance.heading = this.translateService.instant('TERMINATEVNF'); + modalRef.componentInstance.confirmationMessage = this.translateService.instant('TERMINATEVNFCONTENT'); + modalRef.componentInstance.submitMessage = this.translateService.instant('TERMINATEVNF'); + modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => { + if (result.message === CONFIGCONSTANT.done) { + this.onSubmit(); + } + }).catch(); + } + this.isLoadingResults = false; + } + + /** To check the versions are matching or not for 'CHANGE_VNFPKG' type */ + public checkVersion(): void { + this.isLoadingResults = true; + const vnfDetails: {}[] = []; + this.restService.getResource(environment.VNFPACKAGESCONTENT_URL + '/' + this.vnfdId).subscribe((vnfData: VNFD[]): void => { + if (!isNullOrUndefined(vnfData['software-version'])) { + this.version = vnfData['software-version']; + } + this.restService.getResource(environment.VNFPACKAGESCONTENT_URL).subscribe((vnfDetail: VNFD[]): void => { + vnfDetail.forEach((vnfDatas: VNFD): void => { + const vnfDataObj: {} = + { + VNFID: vnfDatas._id, + version: vnfDatas['software-version'] + }; + vnfDetails.push(vnfDataObj); + }); + let vnfIdFilteredData: {}[] = []; + const vnfID: string = 'VNFID'; + const version: string = 'version'; + vnfIdFilteredData = vnfDetails.filter((vnfdData: {}[]): boolean => vnfdData[vnfID] === this.vnfID); + for (const data of vnfIdFilteredData) { + this.vnfversion = data[version]; + } + if (this.version === this.vnfversion) { + const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' }); + modalRef.componentInstance.heading = this.translateService.instant('UPDATEPOLICIES'); + modalRef.componentInstance.confirmationMessage = this.translateService.instant('UPDATEPOLICIESCONTENT'); + modalRef.componentInstance.submitMessage = this.translateService.instant('UPDATEPOLICIES'); + modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => { + if (result.message === CONFIGCONSTANT.done) { + this.onSubmit(); + } + }).catch(); + } else { + const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' }); + modalRef.componentInstance.heading = this.translateService.instant('REDEPLOY'); + modalRef.componentInstance.confirmationMessage = this.translateService.instant('REDEPLOYCONTENT'); + modalRef.componentInstance.submitMessage = this.translateService.instant('REDEPLOY'); + modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => { + if (result.message === CONFIGCONSTANT.done) { + this.onSubmit(); + } + }).catch(); + } + }, (error: ERRORDATA): void => { + this.restService.handleError(error, 'get'); + this.isLoadingResults = false; + }); + this.isLoadingResults = false; + }, (error: ERRORDATA): void => { + this.restService.handleError(error, 'get'); + this.isLoadingResults = false; + }); + } + + /** Initialize the Ns Update @public */ + public nsUpdateInitialization(nsUpdatePayload: object): void { + this.isLoadingResults = true; + const apiURLHeader: APIURLHEADER = { + url: environment.NSDINSTANCES_URL + '/' + this.params.id + '/update', + httpOptions: { headers: this.headers } + }; + const modalData: MODALCLOSERESPONSEDATA = { + message: 'Done' + }; + this.restService.postResource(apiURLHeader, nsUpdatePayload).subscribe((result: {}): void => { + this.activeModal.close(modalData); + this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch(); + }, (error: ERRORDATA): void => { + this.restService.handleError(error, 'post'); + this.isLoadingResults = false; + }); + } + + /** To enable or disable vnfdId field @public */ + public terminateVNF(value: string): void { + this.terminateVnf = value; + if (this.terminateVnf === 'REMOVE_VNF') { + this.vnfdIdShow = true; + this.getFormControl('vnfdId').disable(); + } else { + this.vnfdIdShow = false; + this.getFormControl('vnfdId').enable(); + } + } + + /** Used to get the AbstractControl of controlName passed @private */ + private getFormControl(controlName: string): AbstractControl { + return this.nsUpdateForm.controls[controlName]; + } +} diff --git a/src/app/utilities/warning/WarningComponent.html b/src/app/utilities/warning/WarningComponent.html new file mode 100644 index 0000000..9be2656 --- /dev/null +++ b/src/app/utilities/warning/WarningComponent.html @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/src/app/utilities/warning/WarningComponent.scss b/src/app/utilities/warning/WarningComponent.scss new file mode 100644 index 0000000..c55461a --- /dev/null +++ b/src/app/utilities/warning/WarningComponent.scss @@ -0,0 +1,17 @@ +/* + Copyright 2020 TATA ELXSI + + Licensed under the Apache License, Version 2.0 (the 'License'); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) +*/ \ No newline at end of file diff --git a/src/app/utilities/warning/WarningComponent.ts b/src/app/utilities/warning/WarningComponent.ts new file mode 100644 index 0000000..0ccb888 --- /dev/null +++ b/src/app/utilities/warning/WarningComponent.ts @@ -0,0 +1,74 @@ +/* + Copyright 2020 TATA ELXSI + + Licensed under the Apache License, Version 2.0 (the 'License'); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author: SANDHYA JS (sandhya.j@tataelxsi.co.in) +*/ +/** + * @file WarningConfiguration Model + */ +import { Component, Injector, Input } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +/** + * Creating component + * @Component takes WarningComponent.html as template url + */ +@Component({ + selector: 'app-warning', + templateUrl: './WarningComponent.html', + styleUrls: ['./WarningComponent.scss'] +}) +/** Exporting a class @exports WarningComponent */ +export class WarningComponent { + /** To inject services @public */ + public injector: Injector; + + /** Instance for active modal service @public */ + public activeModal: NgbActiveModal; + + /** Check the loading results @public */ + public isLoad: Boolean = false; + + /** Contains title data @public */ + @Input() + public heading: string; + + /** Contains body data @public */ + @Input() + public confirmationMessage: string; + + /** Contains footer data @public */ + @Input() + public submitMessage: string; + + /** Give the message for the loading @public */ + public message: string = 'PLEASEWAIT'; + + constructor(injector: Injector) { + this.injector = injector; + this.activeModal = this.injector.get(NgbActiveModal); + } + + /** + * Lifecyle Hooks the trigger before component is instantiate + */ + public ngOnInit(): void { + //empty + } + + /** Close the modal @public */ + public closeModal(getMessage: string): void { + this.activeModal.close({ message: getMessage }); + } +} diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 6d8f8be..75c1683 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -174,6 +174,15 @@ "COUNTINDEX": "Index zählen", "MIGRATETOHOST": "Zum Host migrieren", "VMMIGRATION": "VM-Migration", + "NSUPDATE": "Ns-Update", + "UPDATETYPE": "Aktualisierungstyp", + "VNFDID": "Vnfd-ID", + "UPDATEPOLICIES": "Richtlinien aktualisieren", + "REDEPLOY": "Neu bereitstellen und aktualisieren", + "TERMINATEVNF": "Beenden Sie VNF", + "UPDATEPOLICIESCONTENT": "Diese Aktion umfasst die Neuerstellung der Richtlinien dieser VNF. Sind Sie sicher, dass Sie fortfahren möchten", + "REDEPLOYCONTENT": "Diese Aktion umfasst die erneute Bereitstellung aller Ressourcen dieser VNF. Sind Sie sicher, dass Sie fortfahren möchten", + "TERMINATEVNFCONTENT": "Diese Aktion beinhaltet das Beenden dieser VNF. Sind Sie sicher, dass Sie fortfahren möchten", "PAGE": { "DASHBOARD": { "DASHBOARD": "Instrumententafel", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index cdf97a9..882029d 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -166,12 +166,23 @@ "DEFAULT": "Default", "SOURCE": "Source", "RESOURCESNOTFOUND": "Resources not found", + "VNFPKGCHANGE": "CHANGE_VNFPKG", + "REMOVEVNF": "REMOVE_VNF", "SELECTMEMBERVNFINDEX": "Select Member VNF Index", "MEMBERVNFINDEX": "Member VNF Index", "VDUID": "VDU Id", "COUNTINDEX": "Count Index", "MIGRATETOHOST": "Migrate To Host", "VMMIGRATION": "Vm Migration", + "NSUPDATE": "Ns Update", + "UPDATETYPE": "Update Type", + "VNFDID": "Vnfd Id", + "UPDATEPOLICIES": "Update Policies", + "REDEPLOY": "Redeploy and Update", + "TERMINATEVNF": "Terminate VNF", + "UPDATEPOLICIESCONTENT": "This action involves recreating the policies of this VNF. Are you sure you want to proceed", + "REDEPLOYCONTENT": "This action involves redeploying all resources of this VNF. Are you sure you want to proceed", + "TERMINATEVNFCONTENT": "This action involves terminating this VNF. Are you sure you want to proceed", "PAGE": { "DASHBOARD": { "DASHBOARD": "Dashboard", diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json index a6fae2d..65e4167 100644 --- a/src/assets/i18n/es.json +++ b/src/assets/i18n/es.json @@ -166,12 +166,23 @@ "DEFAULT": "por defecto", "SOURCE": "Fuente", "RESOURCESNOTFOUND": "Recursos no encontrados", + "VNFPKGCHANGE": "CAMBIO_VNFPKG", + "REMOVEVNF": "ELIMINAR_VNF", "SELECTMEMBERVNFINDEX": "Seleccione el índice VNF de miembros", "MEMBERVNFINDEX": "Índice VNF de miembros", "VDUID": "Identificación de VDU", "COUNTINDEX": "Índice de conteo", "MIGRATETOHOST": "Migrar a host", "VMMIGRATION": "Migración de máquina virtual", + "NSUPDATE": "Actualización de Ns", + "UPDATETYPE": "Tipo de actualización", + "VNFDID": "ID de vnfd", + "UPDATEPOLICIES": "Políticas de actualización", + "REDEPLOY": "Reimplementar y actualizar", + "TERMINATEVNF": "Terminar VNF", + "UPDATEPOLICIESCONTENT": "Esta acción implica recrear las políticas de este VNF. Estas seguro que deseas continuar", + "REDEPLOYCONTENT": "Esta acción implica redistribuir todos los recursos de este VNF. Estas seguro que deseas continuar", + "TERMINATEVNFCONTENT": "Esta acción implica la terminación de este VNF. Estas seguro que deseas continuar", "PAGE": { "DASHBOARD": { "DASHBOARD": "Tablero", diff --git a/src/assets/i18n/pt.json b/src/assets/i18n/pt.json index c7f3125..c4c4e4f 100644 --- a/src/assets/i18n/pt.json +++ b/src/assets/i18n/pt.json @@ -166,12 +166,23 @@ "DEFAULT": "Padrão", "SOURCE": "Fonte", "RESOURCESNOTFOUND": "Recursos não encontrados", + "VNFPKGCHANGE": "CHANGE_VNFPKG", + "REMOVEVNF": "REMOVE_VNF", "SELECTMEMBERVNFINDEX": "Selecione o Índice VNF do Membro", "MEMBERVNFINDEX": "Índice VNF de Membro", "VDUID": "'VDUID': 'ID Vdu'", "COUNTINDEX": "Índice de contagem", "MIGRATETOHOST": "Migrar para o host", "VMMIGRATION": "Migração de VM", + "NSUPDATE": "Atualização Ns", + "UPDATETYPE": "Tipo de atualização", + "VNFDID": "ID de Vnfd", + "UPDATEPOLICIES": "Atualizar políticas", + "REDEPLOY": "Reimplantar e atualizar", + "TERMINATEVNF": "Encerrar VNF", + "UPDATEPOLICIESCONTENT": "Esta ação envolve a recriação das políticas desta VNF. Tem certeza de que deseja continuar", + "REDEPLOYCONTENT": "Esta ação envolve a redistribuição de todos os recursos desta VNF. Tem certeza de que deseja continuar", + "TERMINATEVNFCONTENT": "Esta ação envolve encerrar este VNF. Tem certeza de que deseja continuar", "PAGE": { "DASHBOARD": { "DASHBOARD": "painel de controle", diff --git a/src/models/CommonModel.ts b/src/models/CommonModel.ts index 437899a..a33e6f3 100644 --- a/src/models/CommonModel.ts +++ b/src/models/CommonModel.ts @@ -71,7 +71,9 @@ export enum CONFIGCONSTANT { sdnOperationalStateThirdStep = 'ERROR', k8OperationalStateFirstStep = 'PROCESSING', k8OperationalStateStateSecondStep = 'ENABLED', - k8OperationalStateThirdStep = 'ERROR' + k8OperationalStateThirdStep = 'ERROR', + done = 'done', + close = 'close' } /** Interface for Post options */ export interface POSTAPIRESOURCE { diff --git a/src/models/NSInstanceModel.ts b/src/models/NSInstanceModel.ts index 1d5fba3..66a6da8 100644 --- a/src/models/NSInstanceModel.ts +++ b/src/models/NSInstanceModel.ts @@ -163,6 +163,28 @@ export interface VDUPARAM { vduCountIndex?: string; } +/** Interface for Ns Update */ +export interface NSUPDATE { + lcmOperationType: string; + updateType: string; + nsInstanceId: string; + changeVnfPackageData: CHANGEVNFDATA; +} + +/** Interface for changeVnfPackageData in Ns Update */ +export interface CHANGEVNFDATA { + vnfdId: string; + vnfInstanceId: string; +} + +/** Interface for terminate vnf in Ns Update */ +export interface TERMINATEVNF { + lcmOperationType: string; + updateType: string; + nsInstanceId: string; + removeVnfInstanceId: string; +} + /** Interface for InstantiateParam */ interface InstantiateParam { nsdId: string; diff --git a/src/models/VNFDModel.ts b/src/models/VNFDModel.ts index 5f2cc05..339dd02 100644 --- a/src/models/VNFDModel.ts +++ b/src/models/VNFDModel.ts @@ -65,6 +65,7 @@ export interface VNFD { usageState?: string; vdu?: VDU[]; version?: string; + 'software-version'?: string; 'virtual-compute-desc'?: string; 'virtual-storage-desc'?: string[]; _admin?: VNFDAdminDetails; diff --git a/tsconfig.json b/tsconfig.json index eea875a..cba3c42 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -152,7 +152,9 @@ "SharedModule": ["src/app/vim-accounts/Resources-Overview/SharedModule"], "ChangePasswordComponent": ["src/app/utilities/change-password/ChangePasswordComponent"], "ChangePasswordModule": ["src/app/utilities/change-password/ChangePasswordModule"], - "VmMigrationComponent": ["src/app/utilities/vm-migration/VmMigrationComponent"] + "VmMigrationComponent": ["src/app/utilities/vm-migration/VmMigrationComponent"], + "NsUpdateComponent": ["src/app/utilities/ns-update/NsUpdateComponent"], + "WarningComponent": ["src/app/utilities/warning/WarningComponent"], } } } \ No newline at end of file -- 2.25.1