def session_chain_delete(session_name, table_name, chain_name):
data = {}
try:
fw.sessions[session_name].chains.delete(
name=chain_name, table=table_name)
return make_response(jsonify(message='Chain deleted'), status.HTTP_200_OK)
except ChainNotFound as e:
http_code = status.HTTP_404_NOT_FOUND
except ChainInUse as e:
http_code = status.HTTP_406_NOT_ACCEPTABLE
data['deps'] = e.deps
except ChainNotValid as e:
http_code = status.HTTP_400_BAD_REQUEST
except Exception as e:
http_code = status.HTTP_500_INTERNAL_SERVER_ERROR
return make_response(jsonify(message='Failed to delete chain', error=e.message, **data), http_code)
评论列表
文章目录