- this.restService.getResource(apiUrl)
- .subscribe((vnfdInfo: {}) => {
- if (vnfdInfo[0]['vnf-configuration'] !== undefined && vnfdInfo[0]['vnf-configuration']) {
- this.getFormControl('vdu_id').setValidators([]);
- this.getFormControl('kdu_name').setValidators([]);
- this.primitiveList = vnfdInfo[0]['vnf-configuration']['config-primitive'];
- }
- if (getType === 'VDU_Primitive') {
- this.kduList = [];
- this.vduList = [];
- this.primitiveList = [];
- if (!isNullOrUndefined(vnfdInfo[0].vdu)) {
- vnfdInfo[0].vdu.forEach((vduData: VDUPRIMITIVELEVEL) => {
- if (vduData['vdu-configuration']) {
- const vduDataObj: VDUPRIMITIVELEVEL = this.generateVDUData(vduData);
- this.vduList.push(vduDataObj);
+ 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);
+ }
+ });
+ });
+ }
+ }