Example #1
0
def get_object(request):
    data = {
        'container_name': request.args['container'],
        'object_name': request.args['object']
    }
    return invoke_method('download_object_as_stream',
                         request,
                         data=json.dumps(data),
                         file_result=True)
def delete_member(request):
    """
    @return:This operation does not return a response body.
    """
    json_data = {'loadbalancer_id': request.args['lb_id'],
                 'member_id': request.args['member_id']}
    return invoke_method('balancer_detach_member', request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
Example #3
0
def delete_record(request):
    json_data = {
        'zone_id': request.args['zone_id'],
        'record_id': request.args['record_id']
    }
    return invoke_method('delete_record',
                         request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
def destroy_balancer(request):
    """
    Get balancer id from params and invoke destroy_balancer driver method.
    @return: Empty response body
    """
    json_data = {'loadbalancer_id': request.args['loadbalancer_id']}
    return invoke_method('destroy_balancer', request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
Example #5
0
def destroy_balancer(request):
    """
    Get balancer id from params and invoke destroy_balancer driver method.
    @return: Empty response body
    """
    json_data = {'loadbalancer_id': request.args['loadbalancer_id']}
    return invoke_method('destroy_balancer',
                         request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
Example #6
0
def create_record(request):
    json_data = json.loads(request.data)
    json_data['zone_id'] = request.args['zone_id']
    response = invoke_method('create_record',
                             request, data=json.dumps(json_data),
                             status_code=httplib.ACCEPTED)
    record_id = json.loads(response.data)['id']
    response.autocorrect_location_header = False
    response.headers.add_header('Location', record_id)
    response.status_code = httplib.CREATED
    return response
Example #7
0
def create_container(request):
    """
    Invoke create_container method and patch response.

    @return: Response object with newly created container name in Location.
    """
    response = invoke_method("create_container", request)
    container_id = json.loads(response.data)["name"]
    response.autocorrect_location_header = False
    response.headers.add_header("Location", container_id)
    response.status_code = httplib.CREATED
    return response
Example #8
0
def create_container(request):
    """
    Invoke create_container method and patch response.

    @return: Response object with newly created container name in Location.
    """
    response = invoke_method('create_container', request)
    container_id = json.loads(response.data)['name']
    response.autocorrect_location_header = False
    response.headers.add_header('Location', container_id)
    response.status_code = httplib.CREATED
    return response
Example #9
0
def delete_member(request):
    """
    @return:This operation does not return a response body.
    """
    json_data = {
        'loadbalancer_id': request.args['lb_id'],
        'member_id': request.args['member_id']
    }
    return invoke_method('balancer_detach_member',
                         request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
def create_node(request):
    """
    Invoke create_node method and patch response.

    @return: Response object with newly created node ID in Location.
    """
    response = invoke_method('create_node', request)
    node_id = json.loads(response.data)['id']
    response.autocorrect_location_header = False
    response.headers.add_header('Location', node_id)
    response.status_code = httplib.CREATED
    return response
Example #11
0
def create_node(request):
    """
    Invoke create_node method and patch response.

    @return: Response object with newly created node ID in Location.
    """
    response = invoke_method('create_node', request)
    node_id = json.loads(response.data)['id']
    response.autocorrect_location_header = False
    response.headers.add_header('Location', node_id)
    response.status_code = httplib.CREATED
    return response
Example #12
0
def create_record(request):
    json_data = json.loads(request.data)
    json_data['zone_id'] = request.args['zone_id']
    response = invoke_method('create_record',
                             request,
                             data=json.dumps(json_data),
                             status_code=httplib.ACCEPTED)
    record_id = json.loads(response.data)['id']
    response.autocorrect_location_header = False
    response.headers.add_header('Location', record_id)
    response.status_code = httplib.CREATED
    return response
Example #13
0
def get_record(request):
    json_data = {
        'zone_id': request.args['zone_id'],
        'record_id': request.args['record_id']
    }
    return invoke_method('get_record', request, data=json.dumps(json_data))
Example #14
0
def list_recods(request):
    json_data = {'zone_id': request.args['zone_id']}
    return invoke_method('list_records', request, data=json.dumps(json_data))
def list_members(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['lb_id']
    return invoke_method('balancer_list_members', request,
                         data=json.dumps(json_data))
Example #16
0
def get_object_metadata(request):
    data = {
        'container_name': request.args['container'],
        'object_name': request.args['object']
    }
    return invoke_method('get_object', request, data=json.dumps(data))
Example #17
0
def get_object(request):
    data = {"container_name": request.args["container"], "object_name": request.args["object"]}
    return invoke_method("download_object_as_stream", request, data=json.dumps(data), file_result=True)
Example #18
0
def list_members(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['lb_id']
    return invoke_method('balancer_list_members',
                         request,
                         data=json.dumps(json_data))
def create_member(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['lb_id']
    return invoke_method('balancer_attach_member', request,
                         data=json.dumps(json_data))
Example #20
0
def get_balancer(request):
    data = json.dumps({'balancer_id': request.args['balancer_id']})
    return invoke_method('get_balancer', request, data=data)
Example #21
0
def update_record(request):
    json_data = json.loads(request.data)
    json_data['zone_id'] = request.args['zone_id']
    json_data['record_id'] = request.args['record_id']
    return invoke_method('update_record', request, data=json.dumps(json_data))
Example #22
0
def delete_container(request):
    data = {"container_name": request.args["container"]}
    return invoke_method("delete_container", request, data=json.dumps(data), status_code=httplib.NO_CONTENT)
Example #23
0
def get_record(request):
    json_data = {'zone_id': request.args['zone_id'],
                 'record_id': request.args['record_id']}
    return invoke_method('get_record', request, data=json.dumps(json_data))
Example #24
0
def delete_zone(request):
    json_data = {'zone_id': request.args['zone_id']}
    return invoke_method('delete_zone', request, data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
Example #25
0
def list_recods(request):
    json_data = {'zone_id': request.args['zone_id']}
    return invoke_method('list_records', request, data=json.dumps(json_data))
Example #26
0
def delete_object(request):
    data = {"container_name": request.args["container"], "object_name": request.args["object"]}
    return invoke_method("delete_object", request, data=json.dumps(data))
Example #27
0
def update_record(request):
    json_data = json.loads(request.data)
    json_data['zone_id'] = request.args['zone_id']
    json_data['record_id'] = request.args['record_id']
    return invoke_method('update_record', request, data=json.dumps(json_data))
def update_balancer(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['loadbalancer_id']
    return invoke_method('update_balancer', request,
                         data=json.dumps(json_data))
Example #29
0
def update_balancer(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['loadbalancer_id']
    return invoke_method('update_balancer',
                         request,
                         data=json.dumps(json_data))
Example #30
0
def list_objects(request):
    data = {'container_name': request.args['cont']}
    return invoke_method('list_container_objects',
                         request,
                         data=json.dumps(data))
Example #31
0
def create_member(request):
    json_data = json.loads(request.data)
    json_data['loadbalancer_id'] = request.args['lb_id']
    return invoke_method('balancer_attach_member',
                         request,
                         data=json.dumps(json_data))
Example #32
0
def get_container(request):
    data = {"container_name": request.args["container"]}
    return invoke_method("get_container", request, data=json.dumps(data))
Example #33
0
def get_container(request):
    data = {'container_name': request.args['container']}
    return invoke_method('get_container', request, data=json.dumps(data))
Example #34
0
def list_objects(request):
    data = {"container_name": request.args["cont"]}
    return invoke_method("list_container_objects", request, data=json.dumps(data))
def destroy_node(request):
    json_data = {'node_id': request.args['node_id']}
    return invoke_method('destroy_node', request, data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
Example #36
0
def delete_container(request):
    data = {'container_name': request.args['container']}
    return invoke_method('delete_container',
                         request,
                         data=json.dumps(data),
                         status_code=httplib.NO_CONTENT)
Example #37
0
def destroy_node(request):
    json_data = {'node_id': request.args['node_id']}
    return invoke_method('destroy_node',
                         request,
                         data=json.dumps(json_data),
                         status_code=httplib.ACCEPTED)
def get_balancer(request):
    data = json.dumps({'balancer_id': request.args['balancer_id']})
    return invoke_method('get_balancer', request, data=data)