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 2
2
3
3
## unreleased
4
4
5
+ * Add missing argument ` dashboard_uid ` to ` get_annotation ` method.
6
+ Thanks, @nikita-b .
7
+
5
8
6
9
## 3.5.0 (2022-12-07)
7
10
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def get_annotation(
12
12
time_to = None ,
13
13
alert_id = None ,
14
14
dashboard_id = None ,
15
+ dashboard_uid = None ,
15
16
panel_id = None ,
16
17
user_id = None ,
17
18
ann_type = None ,
@@ -25,6 +26,7 @@ def get_annotation(
25
26
:param time_to:
26
27
:param alert_id:
27
28
:param dashboard_id:
29
+ :param dashboard_uid:
28
30
:param panel_id:
29
31
:param user_id:
30
32
:param ann_type: Annotation type. On of alert|annotation
@@ -47,6 +49,9 @@ def get_annotation(
47
49
if dashboard_id :
48
50
params .append ("dashboardId=%s" % dashboard_id )
49
51
52
+ if dashboard_uid :
53
+ params .append ("dashboardUID=%s" % dashboard_uid )
54
+
50
55
if panel_id :
51
56
params .append ("panelId=%s" % panel_id )
52
57
Original file line number Diff line number Diff line change @@ -19,13 +19,14 @@ def setUp(self):
19
19
def test_annotations (self , m ):
20
20
m .get (
21
21
"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" ,
23
23
json = [
24
24
{
25
25
"id" : 80 ,
26
26
"alertId" : 11 ,
27
27
"alertName" : "" ,
28
28
"dashboardId" : 111 ,
29
+ "dashboardUID" : "v1Mm5FPVz" ,
29
30
"panelId" : 22 ,
30
31
"userId" : 42 ,
31
32
"type" : "alert" ,
@@ -48,6 +49,7 @@ def test_annotations(self, m):
48
49
time_to = 1563185212275 ,
49
50
alert_id = 11 ,
50
51
dashboard_id = 111 ,
52
+ dashboard_uid = "v1Mm5FPVz" ,
51
53
panel_id = 22 ,
52
54
user_id = 42 ,
53
55
ann_type = "alert" ,
@@ -56,6 +58,7 @@ def test_annotations(self, m):
56
58
)
57
59
self .assertEqual (annotations [0 ]["text" ], "Annotation Description" )
58
60
self .assertEqual (annotations [0 ]["alertId" ], 11 )
61
+ self .assertEqual (annotations [0 ]["dashboardUID" ], "v1Mm5FPVz" )
59
62
self .assertEqual (annotations [0 ]["dashboardId" ], 111 )
60
63
self .assertEqual (annotations [0 ]["panelId" ], 22 )
61
64
self .assertEqual (annotations [0 ]["userId" ], 42 )
You can’t perform that action at this time.
0 commit comments