+
+ elif descriptor_type == 'vnfd':
+ if 'vnfd-catalog' in descriptor:
+ vnfd = descriptor['vnfd-catalog']['vnfd'][0]
+ elif 'vnfd:vnfd-catalog' in descriptor:
+ vnfd = descriptor['vnfd:vnfd-catalog']['vnfd'][0]
+ if node_type == 'vdu':
+ if 'vdu' not in vnfd:
+ vnfd['vdu'] = []
+ vnfd['vdu'].append({
+ "count": "1",
+ "description": "",
+ "monitoring-param": [],
+ "internal-connection-point": [],
+ "image": "ubuntu",
+ #"cloud-init-file": "",
+ "vm-flavor": {},
+ "interface": [],
+ "id": element_id,
+ "name": element_id
+ })
+ if node_type == 'cp':
+ if 'connection-point' not in vnfd:
+ vnfd['connection-point'] = []
+ vnfd['connection-point'].append({
+ "type": "VPORT",
+ "name": element_id
+ })
+
+ if node_type == 'vnf_vl':
+ if 'internal-vld' not in vnfd:
+ vnfd['internal-vld'] = []
+ vnfd['internal-vld'].append({
+ "short-name": element_id,
+ "name": element_id,
+ "internal-connection-point": [],
+ "type": "ELAN",
+ "ip-profile-ref": "",
+ "id": element_id
+ })
+ if node_type == 'interface':
+ for vdu in vnfd['vdu']:
+ if vdu['id'] == args['vdu_id']:
+ vdu['interface'].append({
+ "virtual-interface": {
+ "type": "VIRTIO"
+ },
+ "name": args["name"],
+ "mgmt-interface": True,
+ "type": "EXTERNAL",
+ "external-connection-point-ref": args["external-connection-point-ref"]
+ })
+ if node_type == 'int_cp':
+ for vdu in vnfd['vdu']:
+ if vdu['id'] == args['vdu_id']:
+ if 'internal-connection-point' not in vdu:
+ vdu['internal-connection-point'] = []
+ vdu['internal-connection-point'].append({
+ "short-name": element_id,
+ "type": "VPORT",
+ "id": element_id,
+ "name": element_id
+ })
+ if 'interface' not in vdu:
+ vdu['interface'] = []
+ vdu['interface'].append({
+ "virtual-interface": {
+ "type": "VIRTIO"
+ },
+ "name": "int_"+element_id,
+ "type": "INTERNAL",
+ "internal-connection-point-ref": element_id
+ })
+ for int_vld in vnfd['internal-vld']:
+ if int_vld['id'] == args['vld_id']:
+ if 'internal-connection-point' not in int_vld:
+ int_vld['internal-connection-point'] = []
+ int_vld['internal-connection-point'].append({
+ 'id-ref': element_id
+ })