ves-io-schema-graph-infraprotect-CustomAPI-InTrafficQuery

Examples of performing graph_infraprotect CustomAPI InTrafficQuery

Usecase:

Get data for in traffic

Request:

Request using vesctl:

vesctl request rpc graph_infraprotect.CustomAPI.InTrafficQuery -i request.yaml --uri /public/namespaces/system/graph/infraprotect/intraffic --http-method POST

where file request.yaml has following contents:

endTime: "1580407200"
namespace: system
startTime: "1580403600"

vesctl yaml response:

data:
- name: Total
  values:
  - timestamp: 1591545000000
    value: "203841831.92"
  - timestamp: 1591545600000
    value: "264682002.32"
  - timestamp: 1591546200000
    value: "227940188.06666666"

Request using curl:

curl -X 'POST' -d '{"namespace":"system","startTime":"1580403600","endTime":"1580407200"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/graph/infraprotect/intraffic'

curl response:

HTTP/1.1 200 OK
Content-Length: 364
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:22 GMT
Vary: Accept-Encoding

{
  "data": [
    {
      "name": "Total",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "203841831.92"
        },
        {
          "timestamp": 1591545600000,
          "value": "264682002.32"
        },
        {
          "timestamp": 1591546200000,
          "value": "227940188.06666666"
        }
      ]
    }
  ]
}