Created
October 8, 2018 22:28
-
-
Save Jonnymcc/cc61d41b49af4eb8177f7354a0d24441 to your computer and use it in GitHub Desktop.
Grafana simplejson datasource tag-values endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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