grafana - Grafana 通过 API 覆盖现有仪表板
问题描述
我正在尝试通过 API 覆盖现有的 grafana 仪表板,如下所示:
curl -X POST -H "Content-Type: application/json" "https://api_key:xxx/api/dashboards/db" -d @test.json
而且我面临版本控制问题,无法用我的 json 覆盖相同的仪表板:
{"message":"The dashboard has been changed by someone else","status":"version-mismatch"}⏎
有没有办法避免这种情况并强制覆盖?
谢谢 !
解决方案
这实际上取决于您的test.json
文件中的内容。我希望仪表板模型正确,因此您只需在顶层添加一些字段,例如:
"overwrite": true,
"message": "my saved message, which will be available in the version history"
请参阅 API 文档 - https://grafana.com/docs/grafana/latest/http_api/dashboard/#create-update-dashboard
推荐阅读
- windows - 从 Windows 上的文件路径打开文件
- python - 如何读取格式为 [[xxx],[yyy]] 的行的 .txt 文件,以便直接访问 [xxx] 和 [yyy]?
- resize - 在codeigniter 3中调整图像大小不起作用
- api - 从控制器外部访问属性
- powershell - 无法使用 continue 语句跳过 foreach-object 中的第一次迭代。请建议
- python - 如何合并动态数据框
- flutter - 如何在更改 ListView 或 ListWheelScrollView 的项目时实现轻微的声音
- r - 将字符串转换为 R 中汇总函数的对象参数
- laravel - 如何将 vue 数据显示到 Laravel 刀片?
- android - 在不上线当前版本的情况下创建新的应用程序版本