Skip to content

Instantly share code, notes, and snippets.

View gist:3fe98653abfc8a44abf2fc64528b092d
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: ---[ RESPONSE ]--------------------------------------
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: HTTP/1.1 304 Not Modified
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: Access-Control-Allow-Origin: *
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: Cache-Control: private, max-age=60, s-maxage=60
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: Content-Security-Policy: default-src 'none'
2019-10-22T14:06:59.385Z [DEBUG] plugin.terraform-provider-github_v2.2.1_x4: Date: Tue, 22 Oct 2019 14:06:59 GMT
2019-10-22T14:06:59.385Z [D
@Jonnymcc
Jonnymcc / index.py
Created Oct 8, 2018
Grafana simplejson datasource tag-values endpoint
View index.py
@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':
@Jonnymcc
Jonnymcc / index.py
Created Oct 8, 2018
Grafana simplejson datasource tag-keys endpoint
View index.py
@app.route('/tag-keys', methods=['POST'])
def tag_keys():
data = [
{"type": "string", "text": "City"},
{"type": "string", "text": "Country"}
]
return jsonify(data)
@Jonnymcc
Jonnymcc / index.py
Created Oct 8, 2018
Grafana simplejson datasource annotations endpoint
View index.py
@app.route('/annotations', methods=['POST'])
def annotations():
req = request.get_json()
data = [
{
"annotation": 'This is the annotation',
"time": (convert_to_time_ms(req['range']['from']) +
convert_to_time_ms(req['range']['to'])) / 2,
"title": 'Deployment notes',
"tags": ['tag1', 'tag2'],
@Jonnymcc
Jonnymcc / index.py
Created Oct 8, 2018
Grafana simplejson datasource query endpoint
View index.py
@app.route('/query', methods=['POST'])
def query():
req = request.get_json()
data = [
{
"target": req['targets'][0]['target'],
"datapoints": [
[861, convert_to_time_ms(req['range']['from'])],
[767, convert_to_time_ms(req['range']['to'])]
]
View index.py
@app.route('/search', methods=['POST'])
def search():
return jsonify(['my_series', 'another_series'])
View index.py
@app.route('/')
def health_check():
return 'This datasource is healthy.'