def task_put(volume_id, task_id): client = Client() volume = client.get_volume(volume_id) if not volume: return utils.jsonify({ 'error': VOLUME_NOT_FOUND, 'error_msg': VOLUME_NOT_FOUND_MSG, }, 404) task = Task(id=task_id.encode()) if 'abort' in flask.request.json and flask.request.json['abort']: task.abort() return utils.jsonify({})
def task_delete(volume_id, task_id): client = Client() task = Task(id=task_id.encode()) task.remove() return utils.jsonify({})