问题场景
通过Grafana HTTP API创建Dashboard,其中传入的JSON内容如下
{
"id": null,
"uid": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "25s"
}
结果接口返回报错
Server returned HTTP response code: 422 for URL: http://XXX:8080/api/dashboards/db
解决
JSON格式不正确,应该为
{
"dashboard": {
"id": null,
"uid": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "25s"
},
"folderId": 0,
"folderUid": "l3KqBxCMz",
"message": "Made changes to xyz",
"overwrite": false
}
|