当前位置: 首页>>代码示例>>Python>>正文


Python api.api_method_not_allowed函数代码示例

本文整理汇总了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'])
开发者ID:antonis-m,项目名称:synnefo,代码行数:7,代码来源:projects.py

示例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"])
开发者ID:konsP,项目名称:synnefo,代码行数:7,代码来源:public.py

示例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)
开发者ID:cstavr,项目名称:synnefo,代码行数:7,代码来源:networks.py

示例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'])
开发者ID:antonis-m,项目名称:synnefo,代码行数:7,代码来源:quotas.py

示例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"])
开发者ID:konsP,项目名称:synnefo,代码行数:7,代码来源:subnets.py

示例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)
开发者ID:vkoukis,项目名称:synnefo,代码行数:7,代码来源:images.py

示例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)
开发者ID:AthinaB,项目名称:synnefo,代码行数:7,代码来源:user.py

示例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)
开发者ID:cstavr,项目名称:synnefo,代码行数:7,代码来源:servers.py

示例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'])
开发者ID:antonis-m,项目名称:synnefo,代码行数:7,代码来源:projects.py

示例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)
开发者ID:AthinaB,项目名称:synnefo,代码行数:7,代码来源:user.py

示例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'])
开发者ID:antonis-m,项目名称:synnefo,代码行数:7,代码来源:projects.py

示例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)
开发者ID:vkoukis,项目名称:synnefo,代码行数:7,代码来源:images.py

示例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)
开发者ID:vkoukis,项目名称:synnefo,代码行数:7,代码来源:images.py

示例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)
开发者ID:cstavr,项目名称:synnefo,代码行数:7,代码来源:servers.py

示例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)
开发者ID:cstavr,项目名称:synnefo,代码行数:7,代码来源:public.py


注:本文中的snf_django.lib.api.api_method_not_allowed函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。