ves-io-schema-graph-infraprotect-CustomAPI-MitigationZonesQuery

Examples of performing graph_infraprotect CustomAPI MitigationZonesQuery

Usecase:

Get data for all mitigation zone

Request:

Request using vesctl:

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

where file request.yaml has following contents:

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

vesctl yaml response:

zones:
- 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: "245023"
    - timestamp: 1591545600000
      value: "23722"
    - timestamp: 1591546200000
      value: "23800"
  - name: dropped
    values:
    - timestamp: 1591545000000
      value: "0"
    - timestamp: 1591545600000
      value: "1500"
    - timestamp: 1591546200000
      value: "0"
  uuid: ef636ccf-067e-4338-8940-31510fe2d94b
- bps:
  - name: passed
    values:
    - timestamp: 1591545000000
      value: "67793"
    - timestamp: 1591545600000
      value: "7923930"
    - timestamp: 1591546200000
      value: "93857578"
  - name: dropped
    values:
    - timestamp: 1591545000000
      value: "3"
    - timestamp: 1591545600000
      value: "9000"
    - timestamp: 1591546200000
      value: "0"
  pps:
  - name: passed
    values:
    - timestamp: 1591545000000
      value: "793"
    - timestamp: 1591545600000
      value: "7930"
    - timestamp: 1591546200000
      value: "93578"
  - name: dropped
    values:
    - timestamp: 1591545000000
      value: "1"
    - timestamp: 1591545600000
      value: "90"
    - timestamp: 1591546200000
      value: "0"
  uuid: a8dea289-83d8-4148-b017-7a238fa56f7a

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-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/graph/infraprotect/mitigation'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:05 GMT
Vary: Accept-Encoding

{
  "zones": [
    {
      "uuid": "ef636ccf-067e-4338-8940-31510fe2d94b",
      "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": "245023"
            },
            {
              "timestamp": 1591545600000,
              "value": "23722"
            },
            {
              "timestamp": 1591546200000,
              "value": "23800"
            }
          ]
        },
        {
          "name": "dropped",
          "values": [
            {
              "timestamp": 1591545000000,
              "value": "0"
            },
            {
              "timestamp": 1591545600000,
              "value": "1500"
            },
            {
              "timestamp": 1591546200000,
              "value": "0"
            }
          ]
        }
      ]
    },
    {
      "uuid": "a8dea289-83d8-4148-b017-7a238fa56f7a",
      "bps": [
        {
          "name": "passed",
          "values": [
            {
              "timestamp": 1591545000000,
              "value": "67793"
            },
            {
              "timestamp": 1591545600000,
              "value": "7923930"
            },
            {
              "timestamp": 1591546200000,
              "value": "93857578"
            }
          ]
        },
        {
          "name": "dropped",
          "values": [
            {
              "timestamp": 1591545000000,
              "value": "3"
            },
            {
              "timestamp": 1591545600000,
              "value": "9000"
            },
            {
              "timestamp": 1591546200000,
              "value": "0"
            }
          ]
        }
      ],
      "pps": [
        {
          "name": "passed",
          "values": [
            {
              "timestamp": 1591545000000,
              "value": "793"
            },
            {
              "timestamp": 1591545600000,
              "value": "7930"
            },
            {
              "timestamp": 1591546200000,
              "value": "93578"
            }
          ]
        },
        {
          "name": "dropped",
          "values": [
            {
              "timestamp": 1591545000000,
              "value": "1"
            },
            {
              "timestamp": 1591545600000,
              "value": "90"
            },
            {
              "timestamp": 1591546200000,
              "value": "0"
            }
          ]
        }
      ]
    }
  ]
}