+ else if (desc_type === 'vnfd') {
+ if (['vdu', 'cp'].indexOf(link.source.info.type) > -1 && ['vdu', 'cp'].indexOf(link.target.info.type) > -1) {
+ var vdu_node = (link.source.info.type === 'vdu') ? link.source : link.target;
+ var cp_node = (link.source.info.type === 'cp') ? link.source : link.target;
+
+ var data_form = new FormData();
+ data_form.append('csrfmiddlewaretoken', getCookie('csrftoken'));
+ data_form.append('vdu_id', vdu_node.info.osm.id);
+ data_form.append('external-connection-point-ref', cp_node.info.osm.name);
+ data_form.append('name', "eth_" + generateUID());
+ $.ajax({
+ url: '/projects/descriptors/' + desc_type + '/' + desc_id + '/addElement/interface',
+ type: 'POST',
+ data: data_form,
+ cache: false,
+ contentType: false,
+ processData: false,
+ success: success,
+ error: error
+ });
+ }
+ else if (['vdu', 'vnf_vl'].indexOf(link.source.info.type) > -1 && ['vdu', 'vnf_vl'].indexOf(link.target.info.type) > -1) {
+
+ var vdu_node = (link.source.info.type === 'vdu') ? link.source : link.target;
+ var vld_node = (link.source.info.type === 'vnf_vl') ? link.source : link.target;
+
+ var data_form = new FormData();
+ data_form.append('csrfmiddlewaretoken', getCookie('csrftoken'));
+ data_form.append('vdu_id', vdu_node.info.osm.id);
+ data_form.append('vld_id', vld_node.info.osm.id);
+ data_form.append('id', "intcp_" + generateUID());
+
+ $.ajax({
+ url: '/projects/descriptors/' + desc_type + '/' + desc_id + '/addElement/int_cp',
+ type: 'POST',
+ data: data_form,
+ cache: false,
+ contentType: false,
+ processData: false,
+ success: success,
+ error: error
+ });
+ }
+
+ }
+