From 2b12f710a09ab12f9b9ccf43b4941f1d2fca706e Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Fri, 28 Oct 2022 10:02:40 +0200 Subject: [PATCH] Adjusting env calls --- createDash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/createDash.py b/createDash.py index 712f209..5bc2f53 100644 --- a/createDash.py +++ b/createDash.py @@ -57,7 +57,7 @@ def get_all_dashboards_withname(DTAPIToken, DTENV,name): def remove_dashboards(DTAPIToken, DTENV, dashboards): for dashboard in dashboards: print("Removing dashboard from Dynatrace: "+dashboard["name"]) - DTAPIURL = DTENV + "api/config/v1/dashboards/" + dashboard["id"] + DTAPIURL = DTENV + "/api/config/v1/dashboards/" + dashboard["id"] print(make_request(DTAPIURL,DTAPIToken,True,"delete",None)) def create_or_update_dashboard(DTAPIToken, DTENV, dashboards, templatename, dashname): @@ -70,7 +70,7 @@ def create_or_update_dashboard(DTAPIToken, DTENV, dashboards, templatename, dash existingdashboard = next((dashboard for dashboard in dashboards if dashboard["name"] == dashname), None) if existingdashboard: print("Found dashboard, Name: "+ existingdashboard["name"]) - DTAPIURL = DTENV + "api/config/v1/dashboards/" + existingdashboard["id"] + DTAPIURL = DTENV + "/api/config/v1/dashboards/" + existingdashboard["id"] r = make_request(DTAPIURL,DTAPIToken,True,"get",None) entityResponse = r.json() entityResponse["tiles"] = tilesjson @@ -87,7 +87,7 @@ def create_or_update_dashboard(DTAPIToken, DTENV, dashboards, templatename, dash }, "tiles":[] } - DTAPIURL = DTENV + "api/config/v1/dashboards" + DTAPIURL = DTENV + "/api/config/v1/dashboards" newdashboard["tiles"] = tilesjson print("Creating dashboard: "+newdashboard["dashboardMetadata"]["name"]) print(make_request(DTAPIURL,DTAPIToken,True,"post",json.dumps(newdashboard)))