File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
33## unreleased
4+ - Fixed ` update_dashboard ` to also handle ` folderUid ` well. Thanks, @CantankerousBullMoose .
45
56## 4.3.0 (2025-02-08)
67- Added support for querying all data source-managed alerts. Thanks, @dmyerscough .
Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ async def update_dashboard(self, dashboard):
4040 :return:
4141 """
4242
43- # When the "folderId" is not available within the dashboard payload,
44- # populate it from the nested "meta" object, if given.
45- if "folderId" not in dashboard :
46- if "meta" in dashboard and "folderId" in dashboard ["meta" ]:
47- dashboard = dashboard .copy ()
48- dashboard ["folderId" ] = dashboard ["meta" ]["folderId" ]
43+ # When `folderId` or `folderUid` are not available within the dashboard payload,
44+ # populate them from the nested `meta` object, when given.
45+ for attribute in ["folderId" , "folderUid" ]:
46+ if attribute not in dashboard :
47+ if "meta" in dashboard and attribute in dashboard ["meta" ]:
48+ dashboard = dashboard .copy ()
49+ dashboard [attribute ] = dashboard ["meta" ][attribute ]
4950
5051 put_dashboard_path = "/dashboards/db"
5152 return await self .client .POST (put_dashboard_path , json = dashboard )
Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ def update_dashboard(self, dashboard):
4040 :return:
4141 """
4242
43- # When the "folderId" is not available within the dashboard payload,
44- # populate it from the nested "meta" object, if given.
45- if "folderId" not in dashboard :
46- if "meta" in dashboard and "folderId" in dashboard ["meta" ]:
47- dashboard = dashboard .copy ()
48- dashboard ["folderId" ] = dashboard ["meta" ]["folderId" ]
43+ # When `folderId` or `folderUid` are not available within the dashboard payload,
44+ # populate them from the nested `meta` object, when given.
45+ for attribute in ["folderId" , "folderUid" ]:
46+ if attribute not in dashboard :
47+ if "meta" in dashboard and attribute in dashboard ["meta" ]:
48+ dashboard = dashboard .copy ()
49+ dashboard [attribute ] = dashboard ["meta" ][attribute ]
4950
5051 put_dashboard_path = "/dashboards/db"
5152 return self .client .POST (put_dashboard_path , json = dashboard )
You can’t perform that action at this time.
0 commit comments