+ private getVnfdInfo(vnfdRef: string, getType?: string): void {
+ this.primitiveList = [];
+ this.primitiveParameter = [];
+ this.getFormControl('primitive').setValue(null);
+ const apiUrl: string = environment.VNFPACKAGES_URL + '?product-name=' + vnfdRef;
+ this.isLoadingResults = true;
+ this.restService.getResource(apiUrl)
+ .subscribe((vnfdInfo: VNFD[]): void => {
+ const vnfInstances: VNFD = vnfdInfo[0];
+ if (!isNullOrUndefined(vnfInstances.df) && !isNullOrUndefined(vnfInstances['vnf-configuration'])) {
+ 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 (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;
+ this.restService.handleError(error, 'get');
+ });
+ }
+ /** Get primivitive actions from NSD data */
+ private getNSInfo(nsdRef: string): void {