ves-io-schema-graph-infraprotect-CustomAPI-AlertTrafficQuery

Examples of performing graph_infraprotect CustomAPI AlertTrafficQuery

Usecase:

Get data for alert traffic

Request:

Request using vesctl:

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

where file request.yaml has following contents:

namespace: system

vesctl yaml response:

data:
- name: https (443/tcp)
  values:
  - timestamp: 1591545000000
    value: "5000.000000"
  - timestamp: 1591545600000
    value: "4000.000000"
  - timestamp: 1591546200000
    value: "4800.000000"
- name: https (443/udp)
  values:
  - timestamp: 1591545000000
    value: "933.333333"
  - timestamp: 1591545600000
    value: "933.333333"
  - timestamp: 1591546200000
    value: "1133.333333"
- name: 52349 (52349/tcp)
  values: []
- name: 52113 (52113/tcp)
  values: []

Request using curl:

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

curl response:

HTTP/1.1 200 OK
Content-Length: 858
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:15 GMT
Vary: Accept-Encoding

{
  "data": [
    {
      "name": "https (443/tcp)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "5000.000000"
        },
        {
          "timestamp": 1591545600000,
          "value": "4000.000000"
        },
        {
          "timestamp": 1591546200000,
          "value": "4800.000000"
        }
      ]
    },
    {
      "name": "https (443/udp)",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "933.333333"
        },
        {
          "timestamp": 1591545600000,
          "value": "933.333333"
        },
        {
          "timestamp": 1591546200000,
          "value": "1133.333333"
        }
      ]
    },
    {
      "name": "52349 (52349/tcp)",
      "values": [
      ]
    },
    {
      "name": "52113 (52113/tcp)",
      "values": [
      ]
    }
  ]
}