Пример #1
0
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)
Пример #2
0
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"])
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
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)
Пример #7
0
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)
Пример #8
0
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)
Пример #9
0
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)
Пример #10
0
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'])
Пример #11
0
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)
Пример #12
0
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)
Пример #13
0
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'])
Пример #14
0
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)
Пример #15
0
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'])
Пример #16
0
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)
Пример #17
0
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"])
Пример #18
0
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)
Пример #19
0
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'])
Пример #20
0
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"])
Пример #21
0
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)
Пример #22
0
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'])
Пример #23
0
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)
Пример #24
0
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)
Пример #25
0
def demux_volumes(request, server_id):
    if request.method == 'GET':
        return get_volumes(request, server_id)
    elif request.method == 'POST':
        return attach_volume(request, server_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #26
0
def demux(request):
    if request.method == 'GET':
        return list_keypairs(request)
    elif request.method == 'POST':
        return create_new_keypair(request)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #27
0
def keypair_demux(request, keypair_name):
    if request.method == 'GET':
        return get_keypair(request, keypair_name)
    if request.method == 'DELETE':
        return delete_keypair(request, keypair_name)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #28
0
def demux_volumes_item(request, server_id, volume_id):
    if request.method == 'GET':
        return get_volume_info(request, server_id, volume_id)
    elif request.method == 'DELETE':
        return detach_volume(request, server_id, volume_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #29
0
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'])
Пример #30
0
def compute_demux(request):
    if request.method == 'GET':
        return list_floating_ips(request, _compute_floatingip_list_view)
    elif request.method == 'POST':
        return compute_allocate_floating_ip(request)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #31
0
def demux_volumes_item(request, server_id, volume_id):
    if request.method == 'GET':
        return get_volume_info(request, server_id, volume_id)
    elif request.method == 'DELETE':
        return detach_volume(request, server_id, volume_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #32
0
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,
                                          allowed_methods=['GET', 'DELETE'])
Пример #33
0
def demux_volumes(request, server_id):
    if request.method == 'GET':
        return get_volumes(request, server_id)
    elif request.method == 'POST':
        return attach_volume(request, server_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #34
0
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,
                                          allowed_methods=['GET', 'POST'])
Пример #35
0
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,
                                          allowed_methods=['GET', 'POST'])
Пример #36
0
def demux_server_password(request, server_id):
    if request.method == 'GET':
        return get_server_password(request, server_id)
    elif request.method == 'DELETE':
        return delete_server_password(request, server_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #37
0
def compute_floating_ip_demux(request, floating_ip_id):
    if request.method == 'GET':
        return get_floating_ip(request, floating_ip_id)
    elif request.method == 'DELETE':
        return release_floating_ip(request, floating_ip_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #38
0
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'])
Пример #39
0
def demux(request):
    if request.method == 'GET':
        return list_keypairs(request)
    elif request.method == 'POST':
        return create_new_keypair(request)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #40
0
def compute_floating_ip_demux(request, floating_ip_id):
    if request.method == 'GET':
        return get_floating_ip(request, floating_ip_id)
    elif request.method == 'DELETE':
        return release_floating_ip(request, floating_ip_id)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #41
0
def keypair_demux(request, keypair_name):
    if request.method == 'GET':
        return get_keypair(request, keypair_name)
    if request.method == 'DELETE':
        return delete_keypair(request, keypair_name)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'DELETE'])
Пример #42
0
def compute_demux(request):
    if request.method == 'GET':
        return list_floating_ips(request, _compute_floatingip_list_view)
    elif request.method == 'POST':
        return compute_allocate_floating_ip(request)
    else:
        return api.api_method_not_allowed(request,
                                          allowed_methods=['GET', 'POST'])
Пример #43
0
def server_demux(request, server_id):
    if request.method == 'GET':
        return get_server_details(request, server_id)
    elif request.method == 'PUT':
        return update_server_name(request, server_id)
    elif request.method == 'DELETE':
        return delete_server(request, server_id)
    else:
        return api.api_method_not_allowed(request)
Пример #44
0
def subnet_demux(request, sub_id):
    if request.method == "GET":
        return get_subnet(request, sub_id)
    elif request.method == "DELETE":
        return delete_subnet(request, sub_id)
    elif request.method == "PUT":
        return update_subnet(request, sub_id)
    else:
        return api.api_method_not_allowed(request, allowed_methods=["GET", "DELETE", "PUT"])
Пример #45
0
def metadata_item_demux(request, image_id, key):
    if request.method == 'GET':
        return get_metadata_item(request, image_id, key)
    elif request.method == 'PUT':
        return create_metadata_item(request, image_id, key)
    elif request.method == 'DELETE':
        return delete_metadata_item(request, image_id, key)
    else:
        return api.api_method_not_allowed(request)
Пример #46
0
def server_demux(request, server_id):
    if request.method == 'GET':
        return get_server_details(request, server_id)
    elif request.method == 'PUT':
        return update_server_name(request, server_id)
    elif request.method == 'DELETE':
        return delete_server(request, server_id)
    else:
        return api.api_method_not_allowed(request)
Пример #47
0
def network_demux(request, network_id):
    if request.method == 'GET':
        return get_network_details(request, network_id)
    elif request.method == 'PUT':
        return update_network_name(request, network_id)
    elif request.method == 'DELETE':
        return delete_network(request, network_id)
    else:
        return api.api_method_not_allowed(request)
Пример #48
0
def metadata_item_demux(request, server_id, key):
    if request.method == 'GET':
        return get_metadata_item(request, server_id, key)
    elif request.method == 'PUT':
        return create_metadata_item(request, server_id, key)
    elif request.method == 'DELETE':
        return delete_metadata_item(request, server_id, key)
    else:
        return api.api_method_not_allowed(request)
Пример #49
0
def metadata_item_demux(request, image_id, key):
    if request.method == "GET":
        return get_metadata_item(request, image_id, key)
    elif request.method == "PUT":
        return create_metadata_item(request, image_id, key)
    elif request.method == "DELETE":
        return delete_metadata_item(request, image_id, key)
    else:
        return api.api_method_not_allowed(request)
Пример #50
0
def network_demux(request, network_id):
    if request.method == 'GET':
        return get_network_details(request, network_id)
    elif request.method == 'PUT':
        return update_network_name(request, network_id)
    elif request.method == 'DELETE':
        return delete_network(request, network_id)
    else:
        return api.api_method_not_allowed(request)
Пример #51
0
def subnet_demux(request, sub_id):
    if request.method == 'GET':
        return get_subnet(request, sub_id)
    elif request.method == 'DELETE':
        return delete_subnet(request, sub_id)
    elif request.method == 'PUT':
        return update_subnet(request, sub_id)
    else:
        return api.api_method_not_allowed(request)
Пример #52
0
def port_demux(request, port_id):

    if request.method == 'GET':
        return get_port_details(request, port_id)
    elif request.method == 'DELETE':
        return delete_port(request, port_id)
    elif request.method == 'PUT':
        return update_port(request, port_id)
    else:
        return api.api_method_not_allowed(request)
Пример #53
0
def applications(request):
    method = request.method
    if method == "GET":
        return get_applications(request)
    return api.api_method_not_allowed(request, allowed_methods=['GET'])
Пример #54
0
def demux(request):
    if request.method == 'GET':
        return list_extensions(request)
    else:
        return api.api_method_not_allowed(request, allowed_methods=['GET'])
Пример #55
0
def demux_extension(request, extension_alias):
    if request.method == 'GET':
        return get_extension(request, extension_alias)
    else:
        return api.api_method_not_allowed(request, allowed_methods=['GET'])
Пример #56
0
def object_demux(request, v_account, v_container, v_object):
    if request.method == 'GET':
        return object_read(request, v_account, v_container, v_object)
    else:
        return api.api_method_not_allowed(request, allowed_methods=['GET'])