Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grafana通过API覆盖现有仪表板_Grafana_Grafana Api - Fatal编程技术网

Grafana通过API覆盖现有仪表板

Grafana通过API覆盖现有仪表板,grafana,grafana-api,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"}⏎

我试图通过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文档-

damn。。我把“覆盖”:真的放在元部分,而不是顶层。。。有没有办法将这一行自动放入json模型中?我在导出后手动放置它,这不是很方便…@user2462699我使用python,在这里它是小菜一碟。你可以试着玩jq./sed/。。。