Skip to content
Snippets Groups Projects
Commit 3a46f3f2 authored by arthur.yueh's avatar arthur.yueh
Browse files

bypass untrusted ssl by default when query Grafana, since Grafana usually is set by ourselves

parent 6c0573d9
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ def create_folder(payload): ...@@ -62,7 +62,7 @@ def create_folder(payload):
return (r.status_code, r.content.decode('utf8')) return (r.status_code, r.content.decode('utf8'))
def send_grafana_get(url): def send_grafana_get(url):
r = requests.get(url, headers=http_get_headers) r = requests.get(url, headers=http_get_headers, verify=verifySSL)
if debug: if debug:
log_response(r) log_response(r)
return r return r
......
import os import os
grafana_url = os.getenv('GRAFANA_URL', 'http://localhost:3000') grafana_url = os.getenv('GRAFANA_URL', 'http://localhost:3000')
token = os.getenv('GRAFANA_TOKEN', '') token = os.getenv('GRAFANA_TOKEN', 'eyJrIjoiS1F5Q0haZ3JPMkVMQ1pkbUwwSzlJMk5yNUZ6ZDVVZW4iLCJuIjoiYWRtaW4iLCJpZCI6MX0=')
http_get_headers = {'Authorization': 'Bearer ' + token} http_get_headers = {'Authorization': 'Bearer ' + token}
http_post_headers = {'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json'} http_post_headers = {'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json'}
search_api_limit = 100000 search_api_limit = 100000
debug = False debug = False
verifySSL = False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment