本文整理汇总了Python中snf_django.lib.api.api_method_not_allowed函数的典型用法代码示例。如果您正苦于以下问题:Python api_method_not_allowed函数的具体用法?Python api_method_not_allowed怎么用?Python api_method_not_allowed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_method_not_allowed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: projects
def projects(request):
method = request.method
if method == "GET":
return get_projects(request)
elif method == "POST":
return create_project(request)
return api.api_method_not_allowed(request, allowed_methods=['GET', 'POST'])
示例2: public_demux
def public_demux(request, v_public):
if request.method == "HEAD":
return public_meta(request, v_public)
elif request.method == "GET":
return public_read(request, v_public)
else:
return api.api_method_not_allowed(request, allowed_methods=["HEAD", "GET"])
示例3: demux
def demux(request):
if request.method == 'GET':
return list_networks(request)
elif request.method == 'POST':
return create_network(request)
else:
return api.api_method_not_allowed(request)
示例4: commissions
def commissions(request):
method = request.method
if method == 'GET':
return get_pending_commissions(request)
elif method == 'POST':
return issue_commission(request)
return api.api_method_not_allowed(request, allowed_methods=['GET', 'POST'])
示例5: demux
def demux(request):
if request.method == "GET":
return list_subnets(request)
elif request.method == "POST":
return create_subnet(request)
else:
return api.api_method_not_allowed(request, allowed_methods=["GET", "POST"])
示例6: demux
def demux(request):
if request.method == "GET":
return list_images(request)
elif request.method == "POST":
return create_image(request)
else:
return api.api_method_not_allowed(request)
示例7: users_demux
def users_demux(request):
if request.method == 'GET':
return users_list(request)
elif request.method == 'POST':
return users_create(request)
else:
return api.api_method_not_allowed(request)
示例8: metadata_demux
def metadata_demux(request, server_id):
if request.method == 'GET':
return list_metadata(request, server_id)
elif request.method == 'POST':
return update_metadata(request, server_id)
else:
return api.api_method_not_allowed(request)
示例9: project
def project(request, project_id):
method = request.method
if method == "GET":
return get_project(request, project_id)
if method == "POST":
return modify_project(request, project_id)
return api.api_method_not_allowed(request, allowed_methods=['GET', 'POST'])
示例10: user_demux
def user_demux(request, user_id):
if request.method == 'GET':
return user_detail(request, user_id)
elif request.method == 'PUT':
return user_update(request, user_id)
else:
return api.api_method_not_allowed(request)
示例11: memberships
def memberships(request):
method = request.method
if method == "GET":
return get_memberships(request)
elif method == "POST":
return post_memberships(request)
return api.api_method_not_allowed(request, allowed_methods=['GET', 'POST'])
示例12: image_demux
def image_demux(request, image_id):
if request.method == "GET":
return get_image_details(request, image_id)
elif request.method == "DELETE":
return delete_image(request, image_id)
else:
return api.api_method_not_allowed(request)
示例13: metadata_demux
def metadata_demux(request, image_id):
if request.method == "GET":
return list_metadata(request, image_id)
elif request.method == "POST":
return update_metadata(request, image_id)
else:
return api.api_method_not_allowed(request)
示例14: demux
def demux(request):
if request.method == 'GET':
return list_servers(request)
elif request.method == 'POST':
return create_server(request)
else:
return api.api_method_not_allowed(request)
示例15: public_demux
def public_demux(request, v_public):
if request.method == 'HEAD':
return public_meta(request, v_public)
elif request.method == 'GET':
return public_read(request, v_public)
else:
return api.api_method_not_allowed(request)