From 2a18430a451fb7623360470a85390a7c1660ea7d Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 8 Mar 2016 09:26:15 +0100 Subject: [PATCH] docs(plugin): add table reponse format for queries --- docs/sources/plugins/datasources.md | 41 ++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/sources/plugins/datasources.md b/docs/sources/plugins/datasources.md index 399d99b6292..97ef508b004 100644 --- a/docs/sources/plugins/datasources.md +++ b/docs/sources/plugins/datasources.md @@ -53,7 +53,10 @@ Request object passed to datasource.query function } ``` -Expected response from datasource.query +There are two different kind of results for datasources. +Time series and table. Time series is the most common format and is suppoert by all datasources and panels. Table format is only support by the Influxdb datasource and table panel. But we might se more of this in the future. + +Time series response from datasource.query An array of ```json [ @@ -74,6 +77,42 @@ An array of ] ``` +Table response from datasource.query +An array of +```json +[ + { + "columns": [ + { + "text": "Time", + "type": "time", + "sort": true, + "desc": true, + }, + { + "text": "mean", + }, + { + "text": "sum", + } + ], + "rows": [ + [ + 1457425380000, + null, + null + ], + [ + 1457425370000, + 1002.76215352, + 1002.76215352 + ], + ], + "type": "table" + } +] +``` + ### Annotation Query Request object passed to datasource.annotationsQuery function