File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
33## unreleased
44
5+ * Add missing argument ` dashboard_uid ` to ` get_annotation ` method.
6+ Thanks, @nikita-b .
7+
58
69## 3.5.0 (2022-12-07)
710
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def get_annotation(
1212 time_to = None ,
1313 alert_id = None ,
1414 dashboard_id = None ,
15+ dashboard_uid = None ,
1516 panel_id = None ,
1617 user_id = None ,
1718 ann_type = None ,
@@ -25,6 +26,7 @@ def get_annotation(
2526 :param time_to:
2627 :param alert_id:
2728 :param dashboard_id:
29+ :param dashboard_uid:
2830 :param panel_id:
2931 :param user_id:
3032 :param ann_type: Annotation type. On of alert|annotation
@@ -47,6 +49,9 @@ def get_annotation(
4749 if dashboard_id :
4850 params .append ("dashboardId=%s" % dashboard_id )
4951
52+ if dashboard_uid :
53+ params .append ("dashboardUID=%s" % dashboard_uid )
54+
5055 if panel_id :
5156 params .append ("panelId=%s" % panel_id )
5257
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ def setUp(self):
1919 def test_annotations (self , m ):
2020 m .get (
2121 "http://localhost/api/annotations?from=1563183710618&to=1563185212275"
22- "&alertId=11&dashboardId=111&panelId=22&userId=42&type=alert&tags=tags-test&limit=1" ,
22+ "&alertId=11&dashboardId=111&dashboardUID=v1Mm5FPVz& panelId=22&userId=42&type=alert&tags=tags-test&limit=1" ,
2323 json = [
2424 {
2525 "id" : 80 ,
2626 "alertId" : 11 ,
2727 "alertName" : "" ,
2828 "dashboardId" : 111 ,
29+ "dashboardUID" : "v1Mm5FPVz" ,
2930 "panelId" : 22 ,
3031 "userId" : 42 ,
3132 "type" : "alert" ,
@@ -48,6 +49,7 @@ def test_annotations(self, m):
4849 time_to = 1563185212275 ,
4950 alert_id = 11 ,
5051 dashboard_id = 111 ,
52+ dashboard_uid = "v1Mm5FPVz" ,
5153 panel_id = 22 ,
5254 user_id = 42 ,
5355 ann_type = "alert" ,
@@ -56,6 +58,7 @@ def test_annotations(self, m):
5658 )
5759 self .assertEqual (annotations [0 ]["text" ], "Annotation Description" )
5860 self .assertEqual (annotations [0 ]["alertId" ], 11 )
61+ self .assertEqual (annotations [0 ]["dashboardUID" ], "v1Mm5FPVz" )
5962 self .assertEqual (annotations [0 ]["dashboardId" ], 111 )
6063 self .assertEqual (annotations [0 ]["panelId" ], 22 )
6164 self .assertEqual (annotations [0 ]["userId" ], 42 )
You can’t perform that action at this time.
0 commit comments