فهرست منبع

docs(plugin): add table reponse format for queries

bergquist 9 سال پیش
والد
کامیت
2a18430a45
1فایلهای تغییر یافته به همراه40 افزوده شده و 1 حذف شده
  1. 40 1
      docs/sources/plugins/datasources.md

+ 40 - 1
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
 An array of
 ```json
 ```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
 ### Annotation Query
 
 
 Request object passed to datasource.annotationsQuery function
 Request object passed to datasource.annotationsQuery function