Add monitoring_status, new route for health checks

This commit is contained in:
Guewen Baconnier
2016-10-25 09:39:03 +02:00
parent 982285b298
commit 952a35854e
5 changed files with 49 additions and 0 deletions
@@ -0,0 +1 @@
from . import main
+22
View File
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import json
import werkzeug
from openerp import http
from openerp.addons.web.controllers.main import ensure_db
class Monitoring(http.Controller):
@http.route('/monitoring/status', type='http', auth='none')
def status(self):
ensure_db()
# TODO: add 'sub-systems' status and infos:
# queue job, cron, database, ...
headers = {'Content-Type': 'application/json'}
info = {'status': 1}
return werkzeug.wrappers.Response(json.dumps(info), headers=headers)