|
|
@ -40,6 +40,9 @@ def metrics():
|
|
|
|
"""Expose Prometheus metrics."""
|
|
|
|
"""Expose Prometheus metrics."""
|
|
|
|
return prometheus_client.generate_latest()
|
|
|
|
return prometheus_client.generate_latest()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/thrimshim')
|
|
|
|
|
|
|
|
def thrimshim_all_rows():
|
|
|
|
|
|
|
|
return get_all_rows()
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/thrimshim/<uuid:ident>', methods=['GET', 'POST'])
|
|
|
|
@app.route('/thrimshim/<uuid:ident>', methods=['GET', 'POST'])
|
|
|
|
def thrimshim(ident):
|
|
|
|
def thrimshim(ident):
|
|
|
@ -48,10 +51,7 @@ def thrimshim(ident):
|
|
|
|
row = flask.request.json
|
|
|
|
row = flask.request.json
|
|
|
|
return update_row(ident, row)
|
|
|
|
return update_row(ident, row)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if ident:
|
|
|
|
return get_row(ident)
|
|
|
|
return get_row(ident)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return get_all_rows()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_row(ident):
|
|
|
|
def get_row(ident):
|
|
|
|
"""Gets the row from the database with id == ident."""
|
|
|
|
"""Gets the row from the database with id == ident."""
|
|
|
|