Skip to content

Commit cb8bc93

Browse files
committed
Fix empty dashboard, dashboard update, and example
1 parent 22ef8d9 commit cb8bc93

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

examples/dashboard.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def usage():
103103
]
104104
sort_direction = 'desc'
105105
limit = 10
106-
ok, res = sdclient.add_dashboard_panel(dashboard_configuration, panel_name, panel_type, metrics, sort_direction=sort_direction, limit=limit)
106+
layout = {'col': 1, 'row': 7, 'size_x': 12, 'size_y': 6}
107+
ok, res = sdclient.add_dashboard_panel(dashboard_configuration, panel_name, panel_type, metrics, sort_direction=sort_direction, limit=limit, layout=layout)
107108

108109
# Check the result
109110
if ok:
@@ -122,7 +123,7 @@ def usage():
122123
metrics = [
123124
{'id': 'cpu.used.percent', 'aggregations': {'time': 'avg', 'group': 'avg'}}
124125
]
125-
layout = {'col': 6, 'row': 1, 'size_x': 2, 'size_y': 3}
126+
layout = {'col': 1, 'row': 13, 'size_x': 12, 'size_y': 6}
126127
ok, res = sdclient.add_dashboard_panel(dashboard_configuration, panel_name, panel_type, metrics, layout=layout)
127128

128129
# Check the result

sdcclient/_monitor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@ def create_dashboard(self, name):
361361
dashboard_configuration = {
362362
'name': name,
363363
'schema': 2,
364-
'widgets': []
364+
'widgets': [],
365+
'eventsOverlaySettings': {
366+
'filterNotificationsUserInputFilter': ''
367+
}
365368
}
366369

367370
#
@@ -403,7 +406,8 @@ def add_dashboard_panel(self, dashboard, name, panel_type, metrics, scope=None,
403406
'row': 1,
404407
'size_x': 12,
405408
'size_y': 6
406-
}
409+
},
410+
'customDisplayOptions': {}
407411
}
408412

409413
if panel_type == 'timeSeries':
@@ -531,7 +535,6 @@ def remove_dashboard_panel(self, dashboard, panel_name):
531535
# Clone existing dashboard...
532536
#
533537
dashboard_configuration = copy.deepcopy(dashboard)
534-
del dashboard_configuration['id']
535538

536539
#
537540
# ... find the panel

0 commit comments

Comments
 (0)