From 50cec2abace1a50bf8c7623a8fb91a9011e269c6 Mon Sep 17 00:00:00 2001 From: rforstner Date: Thu, 20 Jan 2022 19:20:57 +0100 Subject: [PATCH] adding new script --- createReport.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/createReport.py b/createReport.py index 0dcecd9..faa0bb5 100644 --- a/createReport.py +++ b/createReport.py @@ -58,8 +58,12 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate): "sloSelector": "text(\"CoCo-QM-Report\")" } r = make_request(DTAPIURL,headers=headers,parameters=parameters,verify=verify) - print(r.content()) - df = pd.json_normalize(r.json()['slo']) + try: + print(r.json()) + df = pd.json_normalize(r.json()['slo']) + except: + print(r.content) + return df