Example #1
0
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)))
Example #2
0
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)))
Example #3
0
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)))
Example #4
0
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)))
Example #5
0
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))
Example #6
0
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))
Example #7
0
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))
Example #8
0
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))
Example #9
0
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))