From 9f840fc8728f3ef255f528e0e49739c618b9de7b Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Thu, 18 May 2023 10:39:22 +0200 Subject: [PATCH 1/2] Adding support for GCDM environments --- createDash.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/createDash.py b/createDash.py index 82ae994..240c6db 100644 --- a/createDash.py +++ b/createDash.py @@ -296,12 +296,14 @@ def main(slo_path): "euprod": { "offset": 0, - "remote_url": 'https://xxu26128.live.dynatrace.com' + "remote_url": 'https://xxu26128.live.dynatrace.com', + "remote_url_gcdm": 'https://moh22956.live.dynatrace.com' }, "naprod": { "offset": 21, - "remote_url": 'https://wgv50241.live.dynatrace.com' + "remote_url": 'https://wgv50241.live.dynatrace.com', + "remote_url_gcdm": 'https://pcj77768.live.dynatrace.com' }, "cnprod": { @@ -346,14 +348,20 @@ def main(slo_path): naslourl = hub_config["naprod"]["remote_url"] + "/ui/slo?id="+configuration["ids"]["na"]+"&sloexp="+configuration["ids"]["na"]+"&slovis=Table" if(configuration["ids"]["cn"]): cnslourl = hub_config["cnprod"]["remote_url"] + "/ui/slo?id="+configuration["ids"]["cn"]+"&sloexp="+configuration["ids"]["cn"]+"&slovis=Table" + dashboard_json.append(get_DataExplorerTile_Markdown(slo_display, slo_department, get_bounds(((boundindex)*(3)) , 0 , 7 , 3), configuration["ops_dashboard"]["emea"], configuration["ops_dashboard"]["na"], configuration["ops_dashboard"]["cn"],configuration["doc_url"],emeaslourl,naslourl,cnslourl)) + for hub,tiles in configuration["hubs"].items(): + if(configuration["hubs"][hub]["type"] == "gcdm"): + remoteurl = hub_config[hub]["remote_url_gcdm"] + else: + remoteurl = hub_config[hub]["remote_url"] if 'actual' in tiles["tiles"]: - dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], hub_config[hub]["remote_url"], get_bounds(((boundindex)*(3)) , 7 + hub_config[hub]["offset"] , 4 , 3), timeframe_actual, slo_graphThreshold_SingleValue)) + dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], remoteurl, get_bounds(((boundindex)*(3)) , 7 + hub_config[hub]["offset"] , 4 , 3), timeframe_actual, slo_graphThreshold_SingleValue)) if "graph" in tiles["tiles"]: dashboard_json.append(get_DataExplorerTile_Graph(slo_name, configuration["metric"], configuration["selector_var"].replace("~",""), hub_config[hub]["remote_url"], get_bounds(((boundindex)*(3)) , 11 + hub_config[hub]["offset"] , 12 , 3), timeframe_graph, "97", "102", slo_graphThreshold_Graph)) if "ytd" in tiles["tiles"]: - dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], hub_config[hub]["remote_url"], get_bounds(((boundindex)*(3)) , 23 + hub_config[hub]["offset"] , 4 , 3), timeframe_ytd, slo_graphThreshold_SingleValue)) + dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], remoteurl, get_bounds(((boundindex)*(3)) , 23 + hub_config[hub]["offset"] , 4 , 3), timeframe_ytd, slo_graphThreshold_SingleValue)) boundindex = boundindex+1 if rowcount > 0 and boundindex > rowcount: with open("dashboard_tiles_"+str(dahboardcount)+".json", "w") as file: From ab9aadad5e2f223b784231dd5f54096fdcff6aa2 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Mon, 22 May 2023 14:41:17 +0200 Subject: [PATCH 2/2] FIX URL BUG --- createDash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/createDash.py b/createDash.py index 240c6db..e45a152 100644 --- a/createDash.py +++ b/createDash.py @@ -359,7 +359,7 @@ def main(slo_path): if 'actual' in tiles["tiles"]: dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], remoteurl, get_bounds(((boundindex)*(3)) , 7 + hub_config[hub]["offset"] , 4 , 3), timeframe_actual, slo_graphThreshold_SingleValue)) if "graph" in tiles["tiles"]: - dashboard_json.append(get_DataExplorerTile_Graph(slo_name, configuration["metric"], configuration["selector_var"].replace("~",""), hub_config[hub]["remote_url"], get_bounds(((boundindex)*(3)) , 11 + hub_config[hub]["offset"] , 12 , 3), timeframe_graph, "97", "102", slo_graphThreshold_Graph)) + dashboard_json.append(get_DataExplorerTile_Graph(slo_name, configuration["metric"], configuration["selector_var"].replace("~",""), remoteurl, get_bounds(((boundindex)*(3)) , 11 + hub_config[hub]["offset"] , 12 , 3), timeframe_graph, "97", "102", slo_graphThreshold_Graph)) if "ytd" in tiles["tiles"]: dashboard_json.append(get_DataExplorerTile_SingleValue(slo_name, configuration["metric"], remoteurl, get_bounds(((boundindex)*(3)) , 23 + hub_config[hub]["offset"] , 4 , 3), timeframe_ytd, slo_graphThreshold_SingleValue)) boundindex = boundindex+1