【问题标题】:Cannot import grafana dashboard via grafana HTTP API无法通过 grafana HTTP API 导入 grafana 仪表板
【发布时间】:2019-11-14 00:40:34
【问题描述】:

我正在尝试使用 HTTP API 导入现有的 json 文件,但“curl”命令抛出错误。

我正在使用下面的命令来导入现有的 json 文件,

curl --user admin:admin "http://localhost:3000/api/dashboards/db" -X POST -H "Content-Type:application/json;charset=UTF-8" --data-binary @/u04/sys_monitor/my_Metrics.json

如果我运行上面的命令,它会抛出类似 "[{"fieldNames":["Dashboard"],"classification":"RequiredError","message":"Required"}]" 的错误

我尝试运行以下命令,

curl --fail --insecure --user admin:admin --request "POST" "http://localhost:3000/api/dashboards/db" --header "Content-Type: application/json" --data-binary @/u04/sys_monitor/my_Metrics.json

对于上面的命令执行,我得到了这样的错误,

curl: (22) The requested URL returned error: 422 Unprocessable Entity

我哪里做错了,请帮助我,

【问题讨论】:

    标签: grafana grafana-api


    【解决方案1】:

    以下评论有效,但未更新 grafana 中的仪表板,

    curl --user admin:admin -vvv "http://localhost:3000/api/dashboards/db" -X POST -d @My_Metrics.json -H 'Content-Type: application/json'
    

    【讨论】:

      猜你喜欢
      • 2018-11-23
      • 1970-01-01
      • 2020-09-13
      • 2019-02-25
      • 2018-05-07
      • 2019-08-28
      • 2020-05-04
      • 2019-11-15
      • 2019-01-29
      相关资源
      最近更新 更多