jsonrpc reference¶
http://groups.google.com/group/json-rpc/web/json-rpc-2-0
- class jsonrpc2.JsonRpcException(rpc_id, code, data=None)¶
Exception for json rpc errors.
errors
code message meaning -32700 Parse error Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. -32600 Invalid Request The JSON sent is not a valid Request object. -32601 Method not found The method does not exist / is not available. -32602 Invalid params Invalid method parameter(s). -32603 Internal error Internal JSON-RPC error. -32099 to -32000 Server error Reserved for implementation-defined server-errors. >>> exc = JsonRpcException(1, INVALID_REQUEST) >>> str(exc) '{"jsonrpc": "2.0", "id": 1, "error": {"message": "Invalid Request", "code": -32600}}'
- class jsonrpc2.JsonRpcBase(methods=None)¶
jsonrpc2 base engine
- JsonRpcBase.__call__(data)¶
execute rpc represented data
- JsonRpcBase.__setitem__(key, value)¶
register rpc function as key. value is callable object or dotted name.
- class jsonrpc2.JsonRpc(methods=None)¶
- JsonRpc.add_module(mod)¶
register all callable in mod module. if callable name is starts with ‘_’, that is excepted.
- class jsonrpc2.JsonRpcApplication(rpcs=None)¶
wsgi json rpc application.
- JsonRpcApplication.__init__(rpcs=None)¶
rpcs is :class:JsonRpc