ves-io-schema-infraprotect-CustomAlertAPI-ListAlerts

Examples of performing infraprotect CustomAlertAPI ListAlerts

Usecase:

List all alerts

Request:

Request using vesctl:

vesctl request rpc infraprotect.CustomAlertAPI.ListAlerts -i request.yaml --uri /public/namespaces/system/infraprotect/alerts --http-method POST

where file request.yaml has following contents:

namespace: system

vesctl yaml response:

alerts:
- bandwidth: "123456"
  endTime: "2022-01-12T15:48:45.997034600Z"
  events:
  - creator: SOC
    endTime: "2022-01-12T15:48:45.997059800Z"
    id: "123"
    ip: 192.168.0.1/31
    name: mainnet_1234_2022
    startTime: "2022-01-12T14:48:45.997047100Z"
  id: "123"
  ip: 192.168.0.1/31
  startTime: "2022-01-12T14:48:45.997021500Z"
  type: DDoS Host Alert

Request using curl:

curl -X 'POST' -d '{"namespace":"system"}' -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/infraprotect/namespaces/system/infraprotect/alerts'

curl response:

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

{
  "alerts": [
    {
      "id": "123",
      "ip": "192.168.0.1/31",
      "start_time": "2022-01-12T14:48:45.997021500Z",
      "end_time": "2022-01-12T15:48:45.997034600Z",
      "bandwidth": "123456",
      "type": "DDoS Host Alert",
      "events": [
        {
          "id": "123",
          "name": "mainnet_1234_2022",
          "creator": "SOC",
          "ip": "192.168.0.1/31",
          "start_time": "2022-01-12T14:48:45.997047100Z",
          "end_time": "2022-01-12T15:48:45.997059800Z",
          "has_details": false,
          "network_id": "",
          "mitigation_id": "",
          "description": ""
        }
      ],
      "arbor_id": "",
      "creator": "",
      "network_id": ""
    }
  ]
}