ves-io-schema-graph-infraprotect-CustomAPI-MitigationZoneQuery

Examples of performing graph_infraprotect CustomAPI MitigationZoneQuery

Usecase:

Get data for mitigation zone

Request:

Request using vesctl:

vesctl request rpc graph_infraprotect.CustomAPI.MitigationZoneQuery -i request.yaml --uri /public/namespaces/system/graph/infraprotect/mitigation/5b931eb7-9a63-49b4-add9-31a7f396d19d --http-method POST

where file request.yaml has following contents:

endTime: "1580407200"
namespace: system
startTime: "1580403600"
zoneUuid: 5b931eb7-9a63-49b4-add9-31a7f396d19d

vesctl yaml response:

bps:
- name: passed
  values:
  - timestamp: 1591545000000
    value: "2450237971"
  - timestamp: 1591545600000
    value: "2372238506"
  - timestamp: 1591546200000
    value: "2380032746"
- name: dropped
  values:
  - timestamp: 1591545000000
    value: "0"
  - timestamp: 1591545600000
    value: "150000"
  - timestamp: 1591546200000
    value: "0"
pps:
- name: passed
  values:
  - timestamp: 1591545000000
    value: "2450237971"
  - timestamp: 1591545600000
    value: "2372238506"
  - timestamp: 1591546200000
    value: "2380032746"
- name: dropped
  values:
  - timestamp: 1591545000000
    value: "0"
  - timestamp: 1591545600000
    value: "150000"
  - timestamp: 1591546200000
    value: "0"

Request using curl:

curl -X 'POST' -d '{"namespace":"system","zoneUuid":"5b931eb7-9a63-49b4-add9-31a7f396d19d","startTime":"1580403600","endTime":"1580407200"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/graph/infraprotect/mitigation/5b931eb7-9a63-49b4-add9-31a7f396d19d'

curl response:

HTTP/1.1 200 OK
Content-Length: 1330
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:07 GMT
Vary: Accept-Encoding

{
  "bps": [
    {
      "name": "passed",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "2450237971"
        },
        {
          "timestamp": 1591545600000,
          "value": "2372238506"
        },
        {
          "timestamp": 1591546200000,
          "value": "2380032746"
        }
      ]
    },
    {
      "name": "dropped",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "0"
        },
        {
          "timestamp": 1591545600000,
          "value": "150000"
        },
        {
          "timestamp": 1591546200000,
          "value": "0"
        }
      ]
    }
  ],
  "pps": [
    {
      "name": "passed",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "2450237971"
        },
        {
          "timestamp": 1591545600000,
          "value": "2372238506"
        },
        {
          "timestamp": 1591546200000,
          "value": "2380032746"
        }
      ]
    },
    {
      "name": "dropped",
      "values": [
        {
          "timestamp": 1591545000000,
          "value": "0"
        },
        {
          "timestamp": 1591545600000,
          "value": "150000"
        },
        {
          "timestamp": 1591546200000,
          "value": "0"
        }
      ]
    }
  ]
}