def session_check_update(session_name, check_name):
try:
req = request.get_json()
if req is None:
req = {}
fw.sessions[session_name].checks.update(name=check_name, **req)
return make_response(jsonify(message='Rollback check updated'), status.HTTP_200_OK)
except CheckNotFound as e:
http_code = status.HTTP_404_NOT_FOUND
except CheckNotValid as e:
http_code = status.HTTP_400_BAD_REQUEST
except CheckNotUpdated as e:
return make_response(jsonify(message='Rollback check not updated'), status.HTTP_204_NO_CONTENT)
except Exception as e:
http_code = status.HTTP_500_INTERNAL_SERVER_ERROR
return make_response(jsonify(message='Failed to update rollback check', error=e.message), http_code)
评论列表
文章目录