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)
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)
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
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
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
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
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))
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))
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))
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 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))
def get_balancer(request): data = json.dumps({'balancer_id': request.args['balancer_id']}) return invoke_method('get_balancer', request, data=data)
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 delete_container(request): data = {"container_name": request.args["container"]} return invoke_method("delete_container", request, data=json.dumps(data), status_code=httplib.NO_CONTENT)
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))
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)
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))
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))
def list_objects(request): data = {'container_name': request.args['cont']} return invoke_method('list_container_objects', request, data=json.dumps(data))
def get_container(request): data = {"container_name": request.args["container"]} return invoke_method("get_container", request, data=json.dumps(data))
def get_container(request): data = {'container_name': request.args['container']} return invoke_method('get_container', request, data=json.dumps(data))
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)
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)