return Response(data={'error': 'Vnf(%s) does not exist' % vnf_inst_id}, status=status.HTTP_404_NOT_FOUND)
resp_data = fill_resp_data(vnf_inst[0])
return Response(data=resp_data, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnf(%s)' % vnf_inst_id}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for vnf_inst in vnf_insts:
arr.append(fill_resp_data(vnf_inst))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnfs'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for vm in vms:
arr.append(fill_vms_data(vm))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vms'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for flavour in flavours:
arr.append(fill_flavours_data(flavour))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get flavours'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for network in networks:
arr.append(fill_networks_data(network))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get networks'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for subnet in subnets:
arr.append(fill_subnets_data(subnet))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get subnets'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for cp in cps:
arr.append(fill_cps_data(cp))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get cps'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
for v in volumes:
arr.append(fill_volumes_data(v))
return Response(data={'resp_data': arr}, status=status.HTTP_200_OK)
- except:
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get volumes'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)