Module scalaris :: Class JSONConnection
[hide private]
[frames] | no frames]

Class JSONConnection

source code


Abstracts connections to scalaris using JSON

Instance Methods [hide private]
 
__init__(self, url='http://localhost:8000', timeout=None)
Creates a JSON connection to the given URL using the given TCP timeout
source code
 
callp(self, path, function, params, retry_if_bad_status=True) source code
 
call(self, function, params, path='/jsonrpc.yaws', retry_if_bad_status=True)
Calls the given function with the given parameters via the JSON interface of scalaris.
source code
 
close(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
encode_value(value)
Encodes the value to the form required by the scalaris JSON API
source code
 
decode_value(value)
Decodes the value from the scalaris JSON API form to a native type
source code
 
check_fail_abort(result)
Processes the result of some Scalaris operation and raises a TimeoutError if found.
source code
 
process_result_read(result)
Processes the result of a read operation.
source code
 
process_result_write(result)
Processes the result of a write operation.
source code
 
process_result_commit(result)
Processes the result of a commit operation.
source code
 
process_result_add_del_on_list(result)
Processes the result of a add_del_on_list operation.
source code
 
process_result_add_on_nr(result)
Processes the result of a add_on_nr operation.
source code
 
process_result_test_and_set(result)
Processes the result of a test_and_set operation.
source code
 
process_result_delete(result)
Processes the result of a delete operation.
source code
 
create_delete_result(result)
Creates a new DeleteResult from the given result list.
source code
 
process_result_req_list_t(result)
Processes the result of a req_list operation of the Transaction class.
source code
 
process_result_req_list_tso(result)
Processes the result of a req_list operation of the TransactionSingleOp class.
source code
 
process_result_vm_get_version(result)
Processes the result of a api_vm/get_version operation.
source code
 
process_result_vm_get_info(result)
Processes the result of a api_vm/get_info operation.
source code
 
process_result_vm_get_number_of_nodes(result)
Processes the result of a api_vm/number_of_nodes operation.
source code
 
process_result_vm_get_nodes(result)
Processes the result of a api_vm/get_nodes operation.
source code
 
process_result_vm_add_nodes(result)
Processes the result of a api_vm/add_nodes operation.
source code
 
process_result_vm_delete_node(result)
Processes the result of a api_vm/shutdown_node and api_vm/kill_node operations.
source code
 
process_result_vm_delete_nodes(result)
Processes the result of a api_vm/shutdown_nodes and api_vm/kill_nodes operations.
source code
 
process_result_vm_delete_nodes_by_name(result)
Processes the result of a api_vm/shutdown_nodes_by_name and api_vm/kill_nodes_by_name operations.
source code
 
process_result_vm_delete_vm(result)
Processes the result of a api_vm/shutdown_vm and api_vm/kill_vm operations.
source code
 
process_result_vm_get_other_vms(result)
Processes the result of a api_vm/get_other_vms operation.
source code
 
process_result_autoscale_check_config(result) source code
 
process_result_autoscale_pull_scale_req(result) source code
 
process_result_autoscale_lock_scale_req(result) source code
 
process_result_autoscale_unlock_scale_req(result) source code
 
process_result_nop(result)
Processes the result of a nop operation.
source code
 
new_req_list_t(other=None)
Returns a new ReqList object allowing multiple parallel requests for the Transaction class.
source code
 
new_req_list_tso(other=None)
Returns a new ReqList object allowing multiple parallel requests for the TransactionSingleOp class.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, url='http://localhost:8000', timeout=None)
(Constructor)

source code 

Creates a JSON connection to the given URL using the given TCP timeout

Overrides: object.__init__

process_result_read(result)
Static Method

source code 

Processes the result of a read operation. Returns the read value on success. Raises the appropriate exception if the operation failed.

process_result_write(result)
Static Method

source code 

Processes the result of a write operation. Raises the appropriate exception if the operation failed.

process_result_commit(result)
Static Method

source code 

Processes the result of a commit operation. Raises the appropriate exception if the operation failed.

process_result_add_del_on_list(result)
Static Method

source code 

Processes the result of a add_del_on_list operation. Raises the appropriate exception if the operation failed.

process_result_add_on_nr(result)
Static Method

source code 

Processes the result of a add_on_nr operation. Raises the appropriate exception if the operation failed.

process_result_test_and_set(result)
Static Method

source code 

Processes the result of a test_and_set operation. Raises the appropriate exception if the operation failed.

process_result_delete(result)
Static Method

source code 

Processes the result of a delete operation. Returns the tuple (<success (True | 'timeout')>, <number of deleted items>, <detailed results>) on success. Raises the appropriate exception if the operation failed.

process_result_req_list_t(result)
Static Method

source code 

Processes the result of a req_list operation of the Transaction class. Returns the tuple (<tlog>, <result>) on success. Raises the appropriate exception if the operation failed.

process_result_req_list_tso(result)
Static Method

source code 

Processes the result of a req_list operation of the TransactionSingleOp class. Returns <result> on success. Raises the appropriate exception if the operation failed.

process_result_vm_get_version(result)
Static Method

source code 

Processes the result of a api_vm/get_version operation. Raises the appropriate exception if the operation failed.

process_result_vm_get_info(result)
Static Method

source code 

Processes the result of a api_vm/get_info operation. Raises the appropriate exception if the operation failed.

process_result_vm_get_number_of_nodes(result)
Static Method

source code 

Processes the result of a api_vm/number_of_nodes operation. Raises the appropriate exception if the operation failed.

process_result_vm_get_nodes(result)
Static Method

source code 

Processes the result of a api_vm/get_nodes operation. Raises the appropriate exception if the operation failed.

process_result_vm_add_nodes(result)
Static Method

source code 

Processes the result of a api_vm/add_nodes operation. Raises the appropriate exception if the operation failed.

process_result_vm_delete_node(result)
Static Method

source code 

Processes the result of a api_vm/shutdown_node and api_vm/kill_node operations. Raises the appropriate exception if the operation failed.

process_result_vm_delete_nodes(result)
Static Method

source code 

Processes the result of a api_vm/shutdown_nodes and api_vm/kill_nodes operations. Raises the appropriate exception if the operation failed.

process_result_vm_delete_nodes_by_name(result)
Static Method

source code 

Processes the result of a api_vm/shutdown_nodes_by_name and api_vm/kill_nodes_by_name operations. Raises the appropriate exception if the operation failed.

process_result_vm_delete_vm(result)
Static Method

source code 

Processes the result of a api_vm/shutdown_vm and api_vm/kill_vm operations. Raises the appropriate exception if the operation failed.

process_result_vm_get_other_vms(result)
Static Method

source code 

Processes the result of a api_vm/get_other_vms operation. Raises the appropriate exception if the operation failed.

process_result_nop(result)
Static Method

source code 

Processes the result of a nop operation. Raises the appropriate exception if the operation failed.