showard | ce12f55 | 2008-09-19 00:48:59 +0000 | [diff] [blame] | 1 | import django.http |
| 2 | from new_tko.tko import rpc_interface, graphing_utils |
showard | 3544486 | 2008-08-07 22:35:30 +0000 | [diff] [blame] | 3 | from autotest_lib.frontend.afe import rpc_handler |
| 4 | |
| 5 | rpc_handler_obj = rpc_handler.RpcHandler((rpc_interface,), |
| 6 | document_module=rpc_interface) |
| 7 | |
| 8 | |
| 9 | def handle_rpc(request): |
| 10 | return rpc_handler_obj.handle_rpc_request(request) |
showard | ce12f55 | 2008-09-19 00:48:59 +0000 | [diff] [blame] | 11 | |
| 12 | |
showard | ef6fe02 | 2009-03-27 20:55:16 +0000 | [diff] [blame^] | 13 | def handle_jsonp_rpc(request): |
| 14 | return rpc_handler_obj.handle_jsonp_rpc_request(request) |
| 15 | |
| 16 | |
| 17 | def rpc_documentation(request): |
| 18 | return rpc_handler_obj.get_rpc_documentation() |
| 19 | |
| 20 | |
showard | ce12f55 | 2008-09-19 00:48:59 +0000 | [diff] [blame] | 21 | def handle_plot(request): |
| 22 | id = request.GET['id'] |
| 23 | max_age = request.GET['max_age'] |
| 24 | return django.http.HttpResponse( |
| 25 | graphing_utils.handle_plot_request(id, max_age), mimetype='image/png') |