proxy.py 672 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import http
  4. proxy_drivers = {}
  5. class ProxyController(http.Controller):
  6. @http.route('/hw_proxy/hello', type='http', auth='none', cors='*')
  7. def hello(self):
  8. return "ping"
  9. @http.route('/hw_proxy/handshake', type='json', auth='none', cors='*')
  10. def handshake(self):
  11. return True
  12. @http.route('/hw_proxy/status_json', type='json', auth='none', cors='*')
  13. def status_json(self):
  14. statuses = {}
  15. for driver in proxy_drivers:
  16. statuses[driver] = proxy_drivers[driver].get_status()
  17. return statuses