}
}
/** Generate vdu section @public */
- public generateVDUData(vduData: VDUPROFILE, vduConfig: VDUCONFIG[]): VDUPROFILE {
- const getVDUConfig: VDUCONFIG = vduConfig.filter((itemData: VDUCONFIG): boolean =>
- itemData.id === vduData['vdu-configuration-id'])[0];
+ public generateVDUData(vduConfig: VDUCONFIG): VDUPROFILE {
return {
- id: vduData.id,
- name: vduData.id,
- 'vdu-configuration': getVDUConfig
+ id: vduConfig.id,
+ name: vduConfig.id,
+ 'vdu-configuration': vduConfig
};
}
/** Generate kdu section @public */
- public generateKDUData(kduData: KDUPRIMITIVELEVEL): KDUPRIMITIVELEVEL {
+ public generateKDUData(kduData: KDUPRIMITIVELEVEL, kduConfig: VDUCONFIG): KDUPRIMITIVELEVEL {
return {
name: kduData.name,
'juju-bundle': kduData['juju-bundle'],
- 'kdu-configuration': kduData['kdu-configuration']
+ 'kdu-configuration': kduConfig
};
}
/** Used to set the validation and value and update the validation and value @public */
this.getFormControl('primitive').setValue(null);
const apiUrl: string = environment.VNFPACKAGES_URL + '?id=' + vnfdRef;
this.isLoadingResults = true;
- this.restService.getResource(apiUrl)
- .subscribe((vnfdInfo: VNFD[]): void => {
+ this.restService.getResource(apiUrl).subscribe((vnfdInfo: VNFD[]): void => {
const vnfInstances: VNFD = vnfdInfo[0];
- if (!isNullOrUndefined(vnfInstances.df) && !isNullOrUndefined(vnfInstances['vnf-configuration'])) {
+ if (!isNullOrUndefined(vnfInstances.df)) {
this.getFormControl('vdu_id').setValidators([]);
this.getFormControl('kdu_name').setValidators([]);
vnfInstances.df.forEach((df: DF): void => {
- if (df['vnf-configuration-id'] !== undefined) {
- const vnfprimitiveList: VNFCONFIG = vnfInstances['vnf-configuration']
- .filter((itemData: VNFCONFIG): boolean => itemData.id === df['vnf-configuration-id'])[0];
- this.primitiveList = vnfprimitiveList['config-primitive'];
+ if (df['lcm-operations-configuration'] !== undefined) {
+ if (df['lcm-operations-configuration']['operate-vnf-op-config'] !== undefined) {
+ const day12Operation: VDUCONFIG[] = df['lcm-operations-configuration']['operate-vnf-op-config']['day1-2'];
+ if (day12Operation !== undefined) {
+ const vnfprimitiveList: VNFCONFIG = day12Operation
+ .filter((itemData: VNFCONFIG): boolean => itemData.id === vnfInstances.id)[0];
+ if (vnfprimitiveList !== undefined) {
+ this.primitiveList = vnfprimitiveList['config-primitive'];
+ }
+ /** VDU Primitive */
+ if (getType === 'VDU_Primitive') {
+ this.kduList = [];
+ this.vduList = [];
+ this.primitiveList = [];
+ df['vdu-profile'].forEach((vduProfile: VDUPROFILE): void => {
+ day12Operation.forEach((element: VDUCONFIG): void => {
+ if (element.id === vduProfile.id){
+ const vduDataObj: VDUPROFILE = this.generateVDUData(element);
+ this.vduList.push(vduDataObj);
+ }
+ });
+ });
+ }
+ /** KDU Primitive */
+ if (getType === 'KDU_Primitive') {
+ this.kduList = [];
+ this.vduList = [];
+ this.primitiveList = [];
+ if (!isNullOrUndefined(vnfInstances.kdu)) {
+ vnfInstances.kdu.forEach((kduData: KDUPRIMITIVELEVEL): void => {
+ day12Operation.forEach((element: VDUCONFIG): void => {
+ if (element.id === kduData.name){
+ const kduDataObj: KDUPRIMITIVELEVEL = this.generateKDUData(kduData, element);
+ this.kduList.push(kduDataObj);
+ }
+ });
+ });
+ }
+ }
+ }
+ }
}
});
}
- if (getType === 'VDU_Primitive') {
- this.kduList = [];
- this.vduList = [];
- this.primitiveList = [];
- if (!isNullOrUndefined(vnfInstances.df) && !isNullOrUndefined(vnfInstances['vdu-configuration'])) {
- vnfInstances.df.forEach((df: DF): void => {
- if (df['vdu-profile'] !== undefined) {
- df['vdu-profile'].forEach((element: VDUPROFILE): void => {
- const vduDataObj: VDUPROFILE = this.generateVDUData(element, vnfInstances['vdu-configuration']);
- this.vduList.push(vduDataObj);
- });
- }
- });
- }
- }
- if (getType === 'KDU_Primitive') {
- this.kduList = [];
- this.vduList = [];
- this.primitiveList = [];
- if (!isNullOrUndefined(vnfInstances.kdu)) {
- vnfInstances.kdu.forEach((kduData: KDUPRIMITIVELEVEL): void => {
- if (kduData['kdu-configuration']) {
- const kduDataObj: KDUPRIMITIVELEVEL = this.generateKDUData(kduData);
- this.kduList.push(kduDataObj);
- }
- });
- }
- }
this.isLoadingResults = false;
}, (error: ERRORDATA): void => {
this.isLoadingResults = false;
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
+import { VDU, VNFD } from 'VNFDModel';
/**
* Creating component
* @Component takes NSInstancesActionComponent.html as template url
public deleteNSInstance(forceAction: boolean): void {
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.componentInstance.params = { forceDeleteType: forceAction };
- modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
+ modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => {
if (result) {
this.sharedService.callData();
}
/** History of operations for an Instanace @public */
public historyOfOperations(): void {
- this.router.navigate(['/instances/ns/history-operations/', this.instanceID]).catch(() => {
+ this.router.navigate(['/instances/ns/history-operations/', this.instanceID]).catch((): void => {
// Catch Navigation Error
});
}
/** NS Topology */
public nsTopology(): void {
- this.router.navigate(['/instances/ns/', this.instanceID]).catch(() => {
+ this.router.navigate(['/instances/ns/', this.instanceID]).catch((): void => {
// Catch Navigation Error
});
}
/** Redirect to Grafana Metrics @public */
public metrics(): void {
this.isLoadingMetricsResult = true;
- this.restService.getResource(environment.NSDINSTANCES_URL + '/' + this.instanceID).subscribe((nsData: NSDDetails[]) => {
- nsData['vnfd-id'].forEach((vnfdID: string[]) => {
+ this.restService.getResource(environment.NSDINSTANCES_URL + '/' + this.instanceID).subscribe((nsData: NSDDetails[]): void => {
+ nsData['vnfd-id'].forEach((vnfdID: string[]): void => {
this.restService.getResource(environment.VNFPACKAGES_URL + '/' + vnfdID)
- .subscribe((vnfd: {}[]) => {
- if (vnfd['monitoring-param'] !== undefined && vnfd['monitoring-param'].length > 0) {
- this.isLoadingMetricsResult = false;
- const location: string = environment.GRAFANA_URL + '/' + this.instanceID + '/osm-ns-metrics-metrics';
- window.open(location);
- } else {
- this.isLoadingMetricsResult = false;
- this.notifierService.notify('error', this.translateService.instant('GRAFANA.METRICSERROR'));
- }
- setTimeout(() => {
+ .subscribe((vnfd: VNFD): void => {
+ vnfd.vdu.forEach((vduData: VDU): void => {
+ if (vduData['monitoring-parameter'] !== undefined && vduData['monitoring-parameter'].length > 0) {
+ this.isLoadingMetricsResult = false;
+ const location: string = environment.GRAFANA_URL + '/' + this.instanceID + '/osm-ns-metrics-metrics';
+ window.open(location);
+ } else {
+ this.isLoadingMetricsResult = false;
+ this.notifierService.notify('error', this.translateService.instant('GRAFANA.METRICSERROR'));
+ }
+ });
+ setTimeout((): void => {
this.cd.detectChanges();
}, this.timeOut);
- }, (error: ERRORDATA) => {
+ }, (error: ERRORDATA): void => {
this.restService.handleError(error, 'get');
this.isLoadingMetricsResult = false;
});
});
- }, (error: ERRORDATA) => {
+ }, (error: ERRORDATA): void => {
this.restService.handleError(error, 'get');
this.isLoadingMetricsResult = false;
});