v1

latestSwagger 2.02026-07-178567199.3 KB
sources
proxy

Query the backend time series data source and return the response according to format

post/sources/{id}/proxy

Path parameters

idstring required

ID of the data source

Request body

querystring required
dbstring
rpstring
epoch'h' | 'm' | 's' | 'ms' | 'u' | 'ns'

timestamp return format

Example request

{
  "query": "select $myfield from cpu where time > now() - 10m",
  "db": "telegraf",
  "rp": "autogen",
  "tempVars": [
    {
      "tempVar": ":myfield:",
      "values": [
        {
          "type": "fieldKey",
          "value": "usage_user"
        }
      ]
    }
  ]
}

Response

Result of the query from the backend time series data source.

resultsobject

results from influx

Example response

{
  "results": [
    {
      "statement_id": 0,
      "series": [
        {
          "name": "cpu",
          "columns": [
            "time",
            "cpu",
            "host",
            "usage_guest",
            "usage_guest_nice",
            "usage_idle",
            "usage_iowait",
            "usage_irq",
            "usage_nice",
            "usage_softirq",
            "usage_steal",
            "usage_system",
            "usage_user"
          ],
          "values": [
            [
              1487785510000,
              "cpu-total",
              "ChristohersMBP2.lan",
              0,
              0,
              76.6916354556804,
              0,
              0,
              0,
              0,
              0,
              4.781523096129837,
              18.526841448189764
            ]
          ]
        }
      ]
    }
  ]
}