- const vduNode: VNFDNODE[] = [{
- nodeTypeRef: 'vdu', id: 'vdu_' + randomID, count: 1, description: '', name: 'vdu_' + randomID, image: 'ubuntu',
- interface: [], 'internal-connection-point': [], 'monitoring-param': [], 'vm-flavor': {}
- }];
- const nodeCopy: VNFDNODE[] = this.nodes;
- Array.prototype.push.apply(vduNode, nodeCopy);
- this.nodes = vduNode;
- if (this.vnfdPackageDetails.vdu === undefined) { this.vnfdPackageDetails.vdu = []; }
- this.vnfdPackageDetails.vdu.push({
- id: 'vdu_' + randomID, count: 1, description: '', name: 'vdu_' + randomID, image: 'ubuntu',
- interface: [], 'internal-connection-point': [], 'monitoring-param': [], 'vm-flavor': {}
- });
- this.addNodes(environment.VNFPACKAGES_URL, this.identifier, this.vnfdPackageDetails);
+ if (this.vnfdPackageDetails['mgmt-cp'] === undefined) {
+ this.notifierService.notify('error', this.translateService.instant('PAGE.TOPOLOGY.ADDCPBEFOREVDU'));
+ } else {
+ if (this.vnfdPackageDetails.vdu === undefined) {
+ this.vnfdPackageDetails.vdu = [];
+ }
+ this.vnfdPackageDetails.vdu.push({
+ id: 'vdu_' + randomID,
+ name: 'vdu_' + randomID,
+ description: '',
+ 'sw-image-desc': 'ubuntu',
+ 'int-cpd': [],
+ 'monitoring-parameter': [],
+ 'virtual-compute-desc': '',
+ 'virtual-storage-desc': []
+ });
+ this.addNodes(environment.VNFPACKAGES_URL, this.identifier, this.vnfdPackageDetails);
+ }