def delete_image(request): logger.debug("---- delete_image ----") json_string = request.body json_body = json.loads(json_string) required_fields = set(['name']) if not required_fields.issubset(json_body[0]): logger.error("Invalid parameters in json body") return HttpResponse(status=500) name = json_body[0]["name"] imageUtils.delete_image_by_name(name) return apiUtils.return_json(True, "Image deleted")
def delete_image(request): """ Deletes an image from Wistar :param request: JSON payload that contains a single object with the following properties: name :return: a JSON object with at least the following properties: status (boolean) and message """ logger.debug("---- delete_image ----") json_string = request.body json_body = json.loads(json_string) required_fields = set(['name']) if not required_fields.issubset(json_body[0]): logger.error("Invalid parameters in json body") return HttpResponse(status=500) name = json_body[0]["name"] imageUtils.delete_image_by_name(name) return apiUtils.return_json(True, "Image deleted")