1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| curl -X POST http://localhost:3000/api/dashboards/db \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Service_Account_Token]" \ -d '{ "dashboard": { "id": null, "uid": null, "title": "InfluxDB Flux Demo", "timezone": "browser", "schemaVersion": 38, "version": 0, "refresh": "30s", "panels": [ { "type": "timeseries", "title": "http_req_duration", "datasource": { "type": "influxdb", "uid": "eei9mxy3v7egwc" }, "targets": [ { "refId": "A", "queryType": "flux", "query": "from(bucket: \"k6_test\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r[\"_measurement\"] == \"http_req_duration\") |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false) |> yield(name: \"last\")" } ], "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 0 } } ] }, "folderId": 0, "overwrite": true }'
|