def get_debug(): """Computes the response of the '/cluster/resources/debug' endpoint. Returns: The DOT graph depicting the context graph. """ gs = app.context_graph_global_state try: return context.compute_graph(gs, 'dot') except collector_error.CollectorError as e: return flask.jsonify(utilities.make_error(str(e)))
def get_cluster(): """Computes the response of the '/cluster' endpoint. Returns: The entire context graph. """ gs = app.context_graph_global_state try: response = context.compute_graph(gs, 'context_graph') return flask.jsonify(response) except collector_error.CollectorError as e: return flask.jsonify(utilities.make_error(str(e)))
def get_debug(): """Computes the response of the '/cluster/resources/debug' endpoint. Returns: The DOT graph depicting the context graph. """ gs = app.context_graph_global_state try: return context.compute_graph(gs, 'dot') except collector_error.CollectorError as e: return flask.jsonify(utilities.make_error(str(e))) except: msg = ('compute_graph(\"dot\") failed with exception %s' % sys.exc_info()[0]) app.logger.exception(msg) return flask.jsonify(utilities.make_error(msg))
def get_cluster(): """Computes the response of the '/cluster' endpoint. Returns: The entire context graph. """ gs = app.context_graph_global_state try: response = context.compute_graph(gs, 'context_graph') return flask.jsonify(response) except collector_error.CollectorError as e: return flask.jsonify(utilities.make_error(str(e))) except: msg = ('compute_graph(\"context_graph\") failed with exception %s' % sys.exc_info()[0]) app.logger.exception(msg) return flask.jsonify(utilities.make_error(msg))
def get_resources(): """Computes the response of the '/cluster/resources' endpoint. Returns: The 'resources' section of the context graph. """ gs = app.context_graph_global_state try: response = context.compute_graph(gs, 'resources') return flask.jsonify(response) except collector_error.CollectorError as e: return flask.jsonify(make_error(str(e))) except: msg = ('compute_graph(\"resources\") failed with exception %s' % sys.exc_info()[0]) app.logger.exception(msg) return flask.jsonify(make_error(msg))