+
+@bottle.route(url_base + '/v3/<tenant_id>/vnfd', method='POST')
+def http_post_vnfs_v3(tenant_id):
+ """
+ Insert one or several VNFs in the catalog, following OSM IM
+ :param tenant_id: tenant owner of the VNF
+ :return: The detailed list of inserted VNFs, following the old format
+ """
+ logger.debug('FROM %s %s %s', bottle.request.remote_addr, bottle.request.method, bottle.request.url)
+ http_content, _ = format_in(None)
+ try:
+ vnfd_uuid_list = nfvo.new_vnfd_v3(mydb, tenant_id, http_content)
+ vnfd_list = []
+ for vnfd_uuid in vnfd_uuid_list:
+ vnf = nfvo.get_vnf_id(mydb, tenant_id, vnfd_uuid)
+ utils.convert_str2boolean(vnf, ('public',))
+ convert_datetime2str(vnf)
+ vnfd_list.append(vnf["vnf"])
+ return format_out({"vnfd": vnfd_list})
+ except (nfvo.NfvoException, db_base_Exception) as e:
+ logger.error("http_post_vnfs error {}: {}".format(e.http_code, str(e)))
+ bottle.abort(e.http_code, str(e))
+ except Exception as e:
+ logger.error("Unexpected exception: ", exc_info=True)
+ bottle.abort(HTTP_Internal_Server_Error, type(e).__name__ + ": " + str(e))
+