ves-io-schema-flow-CustomAPI-TopTalkers

Examples of performing flow CustomAPI TopTalkers

Usecase:

Top Talkers

Request:

Request using vesctl:

vesctl request rpc flow.CustomAPI.TopTalkers -i request.yaml --uri /public/namespaces/system/flows/top_talkers --http-method POST

where file request.yaml has following contents:

endTime: "1593622800"
fieldSelector:
- BYTES
filter: '{SITE="site-1"}'
groupBy:
- SITE
- SRC_IP
startTime: "1593619200"

vesctl yaml response:

data:
- data:
  - labels:
      SITE: site-1
      SRC_IP: 73.83.237.45
    value:
    - timestamp: 1593622800
      value: "1024"
  - labels:
      SITE: site-2
      SRC_IP: 73.83.237.45
    value:
    - timestamp: 1593622800
      value: "1024"

Request using curl:

curl -X 'POST' -d '{"filter":"{SITE="site-1"}","groupBy":["SITE","SRC_IP"],"fieldSelector":["BYTES"],"startTime":"1593619200","endTime":"1593622800"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/system/flows/top_talkers'

curl response:

HTTP/1.1 200 OK
Content-Length: 583
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:48:32 GMT
Vary: Accept-Encoding

{
  "data": [
    {
      "type": "BYTES",
      "data": [
        {
          "labels": {
            "SITE": "site-1",
            "SRC_IP": "73.83.237.45"
          },
          "value": [
            {
              "timestamp": 1593622800,
              "value": "1024"
            }
          ]
        },
        {
          "labels": {
            "SITE": "site-2",
            "SRC_IP": "73.83.237.45"
          },
          "value": [
            {
              "timestamp": 1593622800,
              "value": "1024"
            }
          ]
        }
      ]
    }
  ]
}