+ private getVnfdInfo(vnfdRef: string, getType?: string): void {
+ this.primitiveList = [];
+ this.primitiveParameter = [];
+ this.getFormControl('primitive').setValue(null);
+ const apiUrl: string = environment.VNFPACKAGES_URL + '?id=' + vnfdRef;
+ this.isLoadingResults = true;
+ this.restService.getResource(apiUrl).subscribe((vnfdInfo: VNFD[]): void => {
+ const vnfInstances: VNFD = vnfdInfo[0];
+ if (!isNullOrUndefined(vnfInstances.df)) {
+ this.getFormControl('vdu_id').setValidators([]);
+ this.getFormControl('kdu_name').setValidators([]);
+ vnfInstances.df.forEach((df: DF): void => {
+ 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);
+ }
+ });
+ });
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+ 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 {