ves-io-schema-infraprotect-CustomAlertAPI-GetAlert

Examples of performing infraprotect CustomAlertAPI GetAlert

Usecase:

Get a specific alert

Request:

Request using vesctl:

vesctl request rpc infraprotect.CustomAlertAPI.GetAlert -i request.yaml --uri /public/namespaces/system/infraprotect/alert/12345 --http-method GET

where file request.yaml has following contents:

alertId: "12345"
namespace: system

vesctl yaml response:

ports:
- name: Dynamic
  number: 443
  protocol: https
prefixes:
- cidr: 192.168.0.1/32
  destination: true

Request using curl:

curl -X 'GET' -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/alert/12345?alert_id=12345&namespace=system'

curl response:

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

{
  "ports": [
    {
      "number": 443,
      "protocol": "https",
      "name": "Dynamic",
      "destination": false,
      "bytes": "0",
      "packets": "0"
    }
  ],
  "prefixes": [
    {
      "cidr": "192.168.0.1/32",
      "destination": true,
      "num_bytes": "0",
      "num_packets": "0"
    }
  ]
}