- const constituentVNFD: string[] = [];
- if (this.nsData['constituent-vnfd'] !== undefined) {
- this.nsData['constituent-vnfd'].forEach((ref: CONSTITUENTVNFD) => {
- constituentVNFD.push(ref['vnfd-id-ref'] + ':' + ref['member-vnf-index']);
- });
- }
- const pos: number = constituentVNFD.map((e: string) => { return e; }).indexOf(d.id);
- this.nsData['constituent-vnfd'].splice(pos, 1);
- const getCP: string[] = d.id.split(':');
- const memberVnfIndexRef: number = +getCP[1];
- const vnfdIDRef: string = getCP[0];
- if (this.nsData.vld !== undefined) {
- this.nsData.vld.forEach((resf: VLD) => {
- if (resf['vnfd-connection-point-ref'] !== undefined) {
- resf['vnfd-connection-point-ref'].forEach((connectionPoint: VNFDCONNECTIONPOINTREF, index: number) => {
- if (+connectionPoint['member-vnf-index-ref'] === memberVnfIndexRef && connectionPoint['vnfd-id-ref'] === vnfdIDRef) {
- resf['vnfd-connection-point-ref'].splice(index, 1);
- }
+ this.nsData.df.forEach((resultDF: DF): void => {
+ if (resultDF['vnf-profile'] !== undefined) {
+ /** Remove the vnf-profile related to VNFD */
+ const posVNF: number = resultDF['vnf-profile'].findIndex((e: VNFPROFILE): boolean => {
+ return e['vnfd-id'] === d.name && e.id === d.nodeIndex;
+ });
+ resultDF['vnf-profile'].splice(posVNF, 1);
+ /** Check the VNFD exists in any vnf-profile */
+ const isVNFDExists: boolean = resultDF['vnf-profile'].some((e: VNFPROFILE): boolean => {
+ return e['vnfd-id'] === d.name;
+ });
+ /** If VNFD not exists in the vnf-profile remove from vnfd-id */
+ if (!isVNFDExists) {
+ const posVNFD: number = this.nsData['vnfd-id'].findIndex((e: string): boolean => {
+ return e === d.name;