Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2018 22:28
What would you like to do?
Grafana simplejson datasource tag-values endpoint
@app.route('/tag-values', methods=['POST'])
def tag_values():
req = request.get_json()
if req['key'] == 'City':
return jsonify([
{'text': 'Tokyo'},
{'text': 'São Paulo'},
{'text': 'Jakarta'}
elif req['key'] == 'Country':
return jsonify([
{'text': 'China'},
{'text': 'India'},
{'text': 'United States'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment