+ def _get_ref(desc): # return an identification for the network or vm. Try vim_id if exist, if not descriptor id
+ # for net
+ if desc.get("vim_net_id"):
+ return "'vim-id={}'".format(desc["vim_net_id"])
+ elif desc.get("ns_net_osm_id"):
+ return "'nsd-vld-id={}'".format(desc["ns_net_osm_id"])
+ elif desc.get("vnf_net_osm_id"):
+ return "'vnfd-vld-id={}'".format(desc["vnf_net_osm_id"])
+ # for VM
+ elif desc.get("vim_vm_id"):
+ return "'vim-id={}'".format(desc["vim_vm_id"])
+ elif desc.get("vdu_osm_id"):
+ return "'vnfd-vdu-id={}'".format(desc["vdu_osm_id"])
+ else:
+ return ""
+